Skip to content

Add env vars to filter wasm-bindgen-test-runner tests #1465

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

Merged
merged 1 commit into from
Apr 16, 2019

Conversation

alexcrichton
Copy link
Contributor

This is intended to handle #1458 and #822. These issues stem from
behavior where:

wasm-pack test --node

will actually run both Node.js and browser tests! Two new env vars are
read here, WASM_BINDGEN_TEST_ONLY_{NODE,WEB}, which control which
tests are executed by wasm-bindgen-test-runner. The intention is that
these will be set by wasm-pack to configure which tests are run, and
if test suites are skipped due to the env vars we'll print an
informational message indicating how they can be run.

Closes #822
Closes #1458

@alexcrichton alexcrichton requested a review from fitzgen April 16, 2019 15:04
@RReverser
Copy link
Member

There is no reason for Node.js not to work in experimental-modules mode though, right?

@alexcrichton
Copy link
Contributor Author

Yes when node natively supports ES modules then wasm-bindgen can just require that version of node or later when snippets are required. We don't currently export functionality to use the experimental modules because they're a moving target we haven't been able to keep up with

@RReverser
Copy link
Member

We don't currently export functionality to use the experimental modules

Ah interesting, I was pretty sure I used them with wasm-bindgen, but I guess they were removed in the meanwhile?

This is intended to handle rustwasm#1458 and rustwasm#822. These issues stem from
behavior where:

    wasm-pack test --node

will actually run both Node.js and browser tests! Two new env vars are
read here, `WASM_BINDGEN_TEST_ONLY_{NODE,WEB}`, which control which
tests are executed by `wasm-bindgen-test-runner`. The intention is that
these will be set by `wasm-pack` to configure which tests are run, and
if test suites are skipped due to the env vars we'll print an
informational message indicating how they can be run.

Closes rustwasm#822
Closes rustwasm#1458
@alexcrichton alexcrichton merged commit 5ebfa27 into rustwasm:master Apr 16, 2019
@alexcrichton
Copy link
Contributor Author

@RReverser I added support some time ago to toy around with it but it's likely regressed in the meantime and it wasn't ever really intended to be official

@alexcrichton alexcrichton deleted the only-node-tests branch April 16, 2019 17:42
alexcrichton added a commit to alexcrichton/wasm-pack that referenced this pull request Apr 16, 2019
This builds on rustwasm/wasm-bindgen#1465 by ensuring that `wasm-pack
test --node` will now only test node.js tests
alexcrichton added a commit to alexcrichton/wasm-pack that referenced this pull request Apr 19, 2019
This builds on rustwasm/wasm-bindgen#1465 by ensuring that `wasm-pack
test --node` will now only test node.js tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants