File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,15 @@ impl Test {
243
243
fn step_build_tests ( & mut self ) -> Result < ( ) , Error > {
244
244
info ! ( "Compiling tests to wasm..." ) ;
245
245
246
- build:: cargo_build_wasm_tests ( & self . crate_path , !self . release , & self . extra_options ) ?;
246
+ // If the user has run `wasm-pack test -- --features "f1" -- test_name`, then we want to only pass through
247
+ // `--features "f1"` to `cargo build`
248
+ let extra_options =
249
+ if let Some ( index) = self . extra_options . iter ( ) . position ( |arg| arg == "--" ) {
250
+ & self . extra_options [ ..index]
251
+ } else {
252
+ & self . extra_options
253
+ } ;
254
+ build:: cargo_build_wasm_tests ( & self . crate_path , !self . release , extra_options) ?;
247
255
248
256
info ! ( "Finished compiling tests to wasm." ) ;
249
257
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -380,13 +380,25 @@ fn extra_options_is_passed_to_cargo_when_building_tests() {
380
380
fn smoke() {
381
381
foo::foo();
382
382
}
383
+
384
+ #[wasm_bindgen_test]
385
+ fn fire() {
386
+ panic!("This should be filtered from test execution.");
387
+ }
383
388
"# ,
384
389
)
385
390
. install_local_wasm_bindgen ( ) ;
386
391
let _lock = fixture. lock ( ) ;
387
392
fixture
388
393
. wasm_pack ( )
389
- . args ( & [ "test" , "--node" , "--" , "--no-default-features" ] )
394
+ . args ( & [
395
+ "test" ,
396
+ "--node" ,
397
+ "--" ,
398
+ "--no-default-features" ,
399
+ "--" ,
400
+ "smoke" ,
401
+ ] )
390
402
. assert ( )
391
403
. success ( ) ;
392
404
}
You can’t perform that action at this time.
0 commit comments