wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

--exact flag does not run tests

Open insipx opened this issue 6 months ago • 0 comments

Describe the Bug

Running --exact with name/path of a test does not run the test. this prevents cargo-nextest from working, https://github.com/nextest-rs/nextest/issues/2372#issuecomment-2927914388

Reproduction: https://github.com/insipx/nextest-wasm/blob/main/

Steps to Reproduce

  1. repo I made for reproduction
  2. git clone, ensure wasm-bindgen-cli is at 0.2.100
  3. cargo test --target wasm32-unknown-unknown -- --exact tests::wasm_test
    • gets "no tests to run"
  4. cargo test --target wasm32-unknown-unknown. runs a single test.
    • test should fail with "should panic if running in webassembly"

Expected Behavior

run the single wasm test with wasm-bindgen-test-runner

Actual Behavior

no tests run

 ❯ cargo test --target wasm32-unknown-unknown -- --exact tests::wasm_test
warning: unused import: `super::*`
 --> src/lib.rs:7:9
  |
7 |     use super::*;
  |         ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unreachable statement
  --> src/lib.rs:17:9
   |
16 |         panic!("panic not triggered at all");
   |         ------------------------------------ any code following this expression is unreachable
17 |         println!("did not run webassembly code");
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
   |
   = note: `#[warn(unreachable_code)]` on by default
   = note: this warning originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: `test-nextest` (lib test) generated 2 warnings (run `cargo fix --lib -p test-nextest --tests` to apply 1 suggestion)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests src/lib.rs (target/wasm32-unknown-unknown/debug/deps/test_nextest-373bc291c5c6fd67.wasm)
no tests to run!

insipx avatar Jun 02 '25 14:06 insipx