Skip to content

Commit 54c2c00

Browse files
committed
test_runner: fix spec skip detection
1 parent 57508fb commit 54c2c00

File tree

5 files changed

+577
-2
lines changed

5 files changed

+577
-2
lines changed

lib/internal/test_runner/reporter/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class SpecReporter extends Transform {
100100
ArrayPrototypeShift(this.#reported);
101101
hasChildren = true;
102102
}
103-
const skippedSubtest = subtest && data.skip && data.skip !== undefined;
103+
const skippedSubtest = subtest && 'skip' in data;
104104
const indent = this.#indent(data.nesting);
105105
return `${this.#formatTestReport(type, data, prefix, indent, hasChildren, skippedSubtest)}\n`;
106106
}
Lines 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)