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 4203057

Browse filesBrowse files
MoLowtargos
authored andcommitted
test_runner: fix spec skip detection
PR-URL: #47537 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent daf0c78 commit 4203057
Copy full SHA for 4203057

File tree

Expand file treeCollapse file tree

5 files changed

+579
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+579
-11
lines changed
Open diff view settings
Collapse file

‎lib/internal/test_runner/runner.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ class FileTest extends Test {
190190
let directive;
191191

192192
if (skip) {
193-
directive = this.reporter.getSkip(node.reason);
193+
directive = this.reporter.getSkip(node.reason || true);
194194
} else if (todo) {
195-
directive = this.reporter.getTodo(node.reason);
195+
directive = this.reporter.getTodo(node.reason || true);
196196
} else {
197197
directive = kEmptyObject;
198198
}
Collapse file

‎test/fixtures/test-runner/output/spec_reporter.snapshot‎

Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/spec_reporter.snapshot
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
test with a name and options provided (*ms) # SKIP
151151
functionAndOptions (*ms) # SKIP
152152
escaped description \ # \#\
153-
 (*ms)
153+
 (*ms)
154154
escaped skip message (*ms) # SKIP
155155
escaped todo message (*ms)
156156
escaped diagnostic (*ms)
Collapse file
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --no-warnings
2+
'use strict';
3+
require('../../../common');
4+
const fixtures = require('../../../common/fixtures');
5+
const spawn = require('node:child_process').spawn;
6+
7+
const child = spawn(process.execPath,
8+
['--no-warnings', '--test', '--test-reporter', 'spec', fixtures.path('test-runner/output/output.js')],
9+
{ stdio: 'pipe' });
10+
// eslint-disable-next-line no-control-regex
11+
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, '')));
12+
child.stderr.pipe(process.stderr);

0 commit comments

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