Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement structuredClone() #4083

Open
nicystalker opened this issue Nov 29, 2024 · 1 comment
Open

Implement structuredClone() #4083

nicystalker opened this issue Nov 29, 2024 · 1 comment
Labels

Comments

@nicystalker
Copy link

nicystalker commented Nov 29, 2024

Feature Description

Hello, I would like to use structuredClone() API in my test cases, currently it's not possible:

$ echo 'structuredClone({ hello: "" });' > test.js
$ k6 run test.js

         /\      Grafana   /‾‾/
    /\  /  \     |\  __   /  /
   /  \/    \    | |/ /  /   ‾‾\
  /          \   |   (  |  (‾)  |
 / __________ \  |_|\_\  \_____/

ERRO[0000] ReferenceError: structuredClone is not defined
        at file:///home/arch/k6-tests/test.js:1:43(5)  hint="script exception"

$ echo 'globalThis.structuredClone({ hello: "" });' > test.js
$ k6 run test.js

         /\      Grafana   /‾‾/
    /\  /  \     |\  __   /  /
   /  \/    \    | |/ /  /   ‾‾\
  /          \   |   (  |  (‾)  |
 / __________ \  |_|\_\  \_____/

ERRO[0000] TypeError: Object has no member 'structuredClone'
        at file:///home/arch/k6-tests/test.js:1:54(6)  hint="script exception"

I'm guessing it's not implemented in current k6 version?

I could not find anything related to this, querying the documentation, nor search through search engines.

❯ k6 --version
k6 v0.55.0 (commit/a9ef6638f1, go1.23.2, linux/amd64)

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

@olegbespalov
Copy link
Contributor

That's correct, neither k6 nor sobek have no support of the [structuredClone](https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone) right now 😢

@olegbespalov olegbespalov removed their assignment Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants