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

Add environment variables to configure tests #4295

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

daxpedda
Copy link
Collaborator

@daxpedda daxpedda commented Nov 28, 2024

At the moment the only way to configure the test environment is via the wasm_bindgen_test_configure! macro (apart from Deno). This can make testing setups quite difficult, requiring many test targets to test various environments.

This PR adds environment variables to configure the test environment:

  • WASM_BINDGEN_USE_BROWSER: for browsers
  • WASM_BINDGEN_USE_DEDICATED_WORKER: for dedicated workers
  • WASM_BINDGEN_USE_SHARED_WORKER: for shared workers
  • WASM_BINDGEN_USE_SERVICE_WORKER: for service workers
  • WASM_BINDGEN_USE_DENO: for Deno
  • WASM_BINDGEN_USE_NODE_EXPERIMENTAL: for Node.js but as an ES module

However, wasm_bindgen_test_configure! will overwrite any environment variable and force a specific test environment.

Verified

This commit was signed with the committer’s verified signature.
@daxpedda daxpedda merged commit 473e3db into rustwasm:main Nov 29, 2024
46 checks passed
newpavlov pushed a commit to rust-random/getrandom that referenced this pull request Dec 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This change runs Wasm tests in workers as well.

- Fix Node tests not actually running any tests. It was already broken
because of an interaction with the latest Rust version and an old
Node.js version.
- Test dedicated, shared and service worker by using the newly added
environment variables: rustwasm/wasm-bindgen#4295.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant