File tree 1 file changed +24
-0
lines changed
crates/cli/src/bin/wasm-bindgen-test-runner
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,30 @@ fn rmain() -> Result<(), Error> {
103
103
let headless = env:: var ( "NO_HEADLESS" ) . is_err ( ) ;
104
104
let debug = env:: var ( "WASM_BINDGEN_NO_DEBUG" ) . is_err ( ) ;
105
105
106
+ // Gracefully handle requests to execute only node or only web tests.
107
+ if env:: var_os ( "WASM_BINDGEN_TEST_ONLY_NODE" ) . is_some ( ) {
108
+ if !node {
109
+ println ! ( "this test suite is only configured to run in a browser, \
110
+ but we're only testing node.js tests so skipping") ;
111
+ return Ok ( ( ) ) ;
112
+ }
113
+ }
114
+ if env:: var_os ( "WASM_BINDGEN_TEST_ONLY_WEB" ) . is_some ( ) {
115
+ if node {
116
+ println ! ( "\
117
+ This test suite is only configured to run in node.js, but we're only running
118
+ browser tests so skipping. If you'd like to run the tests in a browser
119
+ include this in your crate when testing:
120
+
121
+ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
122
+
123
+ You'll likely want to put that in a `#[cfg(test)]` module or at the top of an
124
+ integration test.\
125
+ ") ;
126
+ return Ok ( ( ) ) ;
127
+ }
128
+ }
129
+
106
130
// Make the generated bindings available for the tests to execute against.
107
131
shell. status ( "Executing bindgen..." ) ;
108
132
let mut b = Bindgen :: new ( ) ;
You can’t perform that action at this time.
0 commit comments