Hello,
I have a project where I'm trying to add some wasm_bindgen_test
s to verify the code under a headless browser. So far everything is working well on my macOS development machine, where I can run the tests under Firefox headless just fine... but on trying to do the same on Linux (Debian or Ubuntu, which I need for CI), I can't get the tests to run.
Here is what I get on macOS:
macos:~/os/endbasic/web> wasm-pack test --firefox --headless
[INFO]: __ Checking for the Wasm target...
Finished dev [unoptimized + debuginfo] target(s) in 0.09s
[INFO]: __ Installing wasm-bindgen...
Finished test [unoptimized + debuginfo] target(s) in 0.09s
Running /Users/jmmv/os/endbasic/target/wasm32-unknown-unknown/debug/deps/endbasic_web-e38108b278b7445b.wasm
Set timeout to 20 seconds...
Running headless tests in Firefox on `http://127.0.0.1:65190/`
Try find `webdriver.json` for configure browser's capabilities:
Not found
running 9 tests
test endbasic_web::store::tests::test_webstore_put ... ok
test endbasic_web::store::tests::test_webstore_get ... ok
test endbasic_web::store::tests::test_webstore_enumerate ... ok
test endbasic_web::store::tests::test_webstore_delete_missing_file ... ok
test endbasic_web::store::tests::test_webstore_delete_ok ... ok
test endbasic_web::store::tests::test_key_serialized ... ok
test endbasic_web::store::tests::test_key_name ... ok
test endbasic_web::store::tests::test_key_parse ... ok
test endbasic_web::store::tests::test_key_for_name ... ok
test result: ok. 9 passed; 0 failed; 0 ignored
and here is what I get on Linux:
debian:~/os/endbasic/web> wasm-pack test --firefox --headless
[INFO]: Checking for the Wasm target...
Compiling endbasic-web v0.2.0 (/home/jmmv/os/endbasic/web)
Finished dev [unoptimized + debuginfo] target(s) in 0.80s
Finished test [unoptimized + debuginfo] target(s) in 0.06s
Running /home/jmmv/os/endbasic/target/wasm32-unknown-unknown/debug/deps/endbasic_web-30b87b6ae2b1c12f.wasm
no tests to run!
I've even tried to add a trivial tests/wasm.rs
file, following online documentation, with a minimum test as follows:
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
fn pass() {
assert_eq!(1, 1);
}
and I get the same behavior.
Looking a bit further, I see that the wasm-bindgen-test-runner
has a code snippet to check for tests in wasm-bindgen/main.rs at main · rustwasm/wasm-bindgen · GitHub, and it mentions that there is some bug... which makes it sound suspicious.
Any ideas about what's going on here?
Thanks!