You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_runner: detect only tests when --test is not used
This commit updates the way the test runner processes 'only'
tests when node:test files are run without the --test CLI.
This is a breaking change.
PR-URL: #54881
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@@ -521,9 +517,9 @@ Error [ERR_TEST_FAILURE]: test could not be started because its parent finished
521
517
<!-- Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:86:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event. -->
522
518
<!-- Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:251:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event. -->
523
519
<!-- Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:269:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event. -->
Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/output.snapshot
+7-15
Original file line number
Diff line number
Diff line change
@@ -463,35 +463,27 @@ ok 48 - callback async throw after done
463
463
---
464
464
duration_ms: *
465
465
...
466
-
# Subtest: only is set but not in only mode
466
+
# Subtest: only is set on subtests but not in only mode
467
467
# Subtest: running subtest 1
468
468
ok 1 - running subtest 1
469
469
---
470
470
duration_ms: *
471
471
...
472
-
# Subtest: running subtest 2
473
-
ok 2 - running subtest 2
474
-
---
475
-
duration_ms: *
476
-
...
477
-
# 'only' and 'runOnly' require the --test-only command-line option.
478
472
# Subtest: running subtest 3
479
-
ok 3 - running subtest 3
473
+
ok 2 - running subtest 3
480
474
---
481
475
duration_ms: *
482
476
...
483
-
# 'only' and 'runOnly' require the --test-only command-line option.
484
477
# Subtest: running subtest 4
485
-
ok 4 - running subtest 4
478
+
ok 3 - running subtest 4
486
479
---
487
480
duration_ms: *
488
481
...
489
-
1..4
490
-
ok 49 - only is set but not in only mode
482
+
1..3
483
+
ok 49 - only is set on subtests but not in only mode
491
484
---
492
485
duration_ms: *
493
486
...
494
-
# 'only' and 'runOnly' require the --test-only command-line option.
495
487
# Subtest: custom inspect symbol fail
496
488
not ok 50 - custom inspect symbol fail
497
489
---
@@ -718,9 +710,9 @@ not ok 62 - invalid subtest fail
718
710
# Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
719
711
# Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event.
720
712
# Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:(LINE):1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event.
Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/spec_reporter.snapshot
+4-8
Original file line number
Diff line number
Diff line change
@@ -185,15 +185,11 @@
185
185
*
186
186
187
187
callback async throw after done (*ms)
188
-
only is set but not in only mode
188
+
only is set on subtests but not in only mode
189
189
running subtest 1 (*ms)
190
-
running subtest 2 (*ms)
191
-
'only' and 'runOnly' require the --test-only command-line option.
192
190
running subtest 3 (*ms)
193
-
'only' and 'runOnly' require the --test-only command-line option.
194
191
running subtest 4 (*ms)
195
-
only is set but not in only mode (*ms)
196
-
'only' and 'runOnly' require the --test-only command-line option.
192
+
only is set on subtests but not in only mode (*ms)
197
193
custom inspect symbol fail (*ms)
198
194
customized
199
195
@@ -304,9 +300,9 @@
304
300
Error: Test "immediate reject - passes but warns" at test/fixtures/test-runner/output/output.js:86:1 generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
305
301
Error: Test "callback called twice in different ticks" at test/fixtures/test-runner/output/output.js:251:1 generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event.
306
302
Error: Test "callback async throw after done" at test/fixtures/test-runner/output/output.js:269:1 generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event.
0 commit comments