File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,9 @@ class Test extends AsyncResource {
247
247
}
248
248
249
249
if ( testOnlyFlag && ! this . only ) {
250
- skip = '\'only\' option not set' ;
250
+ skip = "'only' option not set" ;
251
+ } else if ( ! testOnlyFlag && ( only || this . runOnlySubtests ) ) {
252
+ this . emitOnlyWarning = true ;
251
253
}
252
254
253
255
if ( skip ) {
@@ -710,6 +712,13 @@ class Test extends AsyncResource {
710
712
for ( let i = 0 ; i < this . diagnostics . length ; i ++ ) {
711
713
this . reporter . diagnostic ( this . nesting , kFilename , this . diagnostics [ i ] ) ;
712
714
}
715
+
716
+ if ( this . emitOnlyWarning ) {
717
+ const warning =
718
+ "to use 'only' or 'runOnly' in the test runner" +
719
+ ' run node with the --test-only command-line option.' ;
720
+ this . reporter . diagnostic ( this . nesting , kFilename , warning ) ;
721
+ }
713
722
}
714
723
715
724
reportStarted ( ) {
Original file line number Diff line number Diff line change @@ -475,11 +475,13 @@ ok 52 - callback async throw after done
475
475
---
476
476
duration_ms: *
477
477
...
478
+ # to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
478
479
# Subtest: running subtest 3
479
480
ok 3 - running subtest 3
480
481
---
481
482
duration_ms: *
482
483
...
484
+ # to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
483
485
# Subtest: running subtest 4
484
486
ok 4 - running subtest 4
485
487
---
@@ -490,6 +492,7 @@ ok 53 - only is set but not in only mode
490
492
---
491
493
duration_ms: *
492
494
...
495
+ # to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
493
496
# Subtest: custom inspect symbol fail
494
497
not ok 54 - custom inspect symbol fail
495
498
---
Original file line number Diff line number Diff line change @@ -476,11 +476,13 @@ TAP version 13
476
476
---
477
477
duration_ms: *
478
478
...
479
+ # to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
479
480
# Subtest: running subtest 3
480
481
ok 3 - running subtest 3
481
482
---
482
483
duration_ms: *
483
484
...
485
+ # to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
484
486
# Subtest: running subtest 4
485
487
ok 4 - running subtest 4
486
488
---
@@ -491,6 +493,7 @@ TAP version 13
491
493
---
492
494
duration_ms: *
493
495
...
496
+ # to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
494
497
# Subtest: custom inspect symbol fail
495
498
not ok 54 - custom inspect symbol fail
496
499
---
Original file line number Diff line number Diff line change 199
199
only is set but not in only mode
200
200
running subtest 1 (*ms)
201
201
running subtest 2 (*ms)
202
+ to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
202
203
running subtest 3 (*ms)
204
+ to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
203
205
running subtest 4 (*ms)
204
206
only is set but not in only mode (*ms)
207
+ to use 'only' or 'runOnly' in the test runner run node with the --test-only command-line option.
205
208
206
209
custom inspect symbol fail (*ms)
207
210
customized
You can’t perform that action at this time.
0 commit comments