Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ffa86f7

Browse filesBrowse files
richiemccolltargos
authored andcommitted
test_runner: emit test-only diagnostic warning
PR-URL: #46540 Fixes: #46448 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3a1a7fa commit ffa86f7
Copy full SHA for ffa86f7

File tree

Expand file treeCollapse file tree

4 files changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+15
-0
lines changed
Open diff view settings
Collapse file

‎lib/internal/test_runner/test.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/test.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ class Test extends AsyncResource {
278278
};
279279
this.waitingOn = 0;
280280
this.finished = false;
281+
282+
if (!testOnlyFlag && (only || this.runOnlySubtests)) {
283+
const warning =
284+
"'only' and 'runOnly' require the --test-only command-line option.";
285+
this.diagnostic(warning);
286+
}
281287
}
282288

283289
hasConcurrency() {
Collapse file

‎test/message/test_runner_output.out‎

Copy file name to clipboardExpand all lines: test/message/test_runner_output.out
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,13 @@ ok 52 - callback async throw after done
475475
---
476476
duration_ms: *
477477
...
478+
# 'only' and 'runOnly' require the --test-only command-line option.
478479
# Subtest: running subtest 3
479480
ok 3 - running subtest 3
480481
---
481482
duration_ms: *
482483
...
484+
# 'only' and 'runOnly' require the --test-only command-line option.
483485
# Subtest: running subtest 4
484486
ok 4 - running subtest 4
485487
---
@@ -490,6 +492,7 @@ ok 53 - only is set but not in only mode
490492
---
491493
duration_ms: *
492494
...
495+
# 'only' and 'runOnly' require the --test-only command-line option.
493496
# Subtest: custom inspect symbol fail
494497
not ok 54 - custom inspect symbol fail
495498
---
Collapse file

‎test/message/test_runner_output_cli.out‎

Copy file name to clipboardExpand all lines: test/message/test_runner_output_cli.out
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,13 @@ ok 52 - callback async throw after done
475475
---
476476
duration_ms: *
477477
...
478+
# 'only' and 'runOnly' require the --test-only command-line option.
478479
# Subtest: running subtest 3
479480
ok 3 - running subtest 3
480481
---
481482
duration_ms: *
482483
...
484+
# 'only' and 'runOnly' require the --test-only command-line option.
483485
# Subtest: running subtest 4
484486
ok 4 - running subtest 4
485487
---
@@ -490,6 +492,7 @@ ok 53 - only is set but not in only mode
490492
---
491493
duration_ms: *
492494
...
495+
# 'only' and 'runOnly' require the --test-only command-line option.
493496
# Subtest: custom inspect symbol fail
494497
not ok 54 - custom inspect symbol fail
495498
---
Collapse file

‎test/message/test_runner_output_spec_reporter.out‎

Copy file name to clipboardExpand all lines: test/message/test_runner_output_spec_reporter.out
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,12 @@
199199
only is set but not in only mode
200200
running subtest 1 (*ms)
201201
running subtest 2 (*ms)
202+
'only' and 'runOnly' require the --test-only command-line option.
202203
running subtest 3 (*ms)
204+
'only' and 'runOnly' require the --test-only command-line option.
203205
running subtest 4 (*ms)
204206
only is set but not in only mode (*ms)
207+
'only' and 'runOnly' require the --test-only command-line option.
205208

206209
custom inspect symbol fail (*ms)
207210
customized

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.