Skip to content

Commit 8b02485

Browse files
aduh95danielleadams
authored andcommitted
test_runner: do not report an error when tests are passing
PR-URL: #43919 Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 9c699bd commit 8b02485

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/internal/main/test_runner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function runTestFile(path) {
114114
err = error;
115115
});
116116

117-
const { 0: { code, signal }, 1: stdout, 2: stderr } = await SafePromiseAll([
117+
const { 0: { 0: code, 1: signal }, 1: stdout, 2: stderr } = await SafePromiseAll([
118118
once(child, 'exit', { signal: t.signal }),
119119
child.stdout.toArray({ signal: t.signal }),
120120
child.stderr.toArray({ signal: t.signal }),

test/parallel/test-runner-exit-code.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
const common = require('../common');
3+
const fixtures = require('../common/fixtures');
34
const assert = require('assert');
45
const { spawnSync } = require('child_process');
56
const { setTimeout } = require('timers/promises');
@@ -28,6 +29,10 @@ if (process.argv[2] === 'child') {
2829
assert.strictEqual(child.status, 0);
2930
assert.strictEqual(child.signal, null);
3031

32+
child = spawnSync(process.execPath, ['--test', fixtures.path('test-runner', 'subdir', 'subdir_test.js')]);
33+
assert.strictEqual(child.status, 0);
34+
assert.strictEqual(child.signal, null);
35+
3136
child = spawnSync(process.execPath, [__filename, 'child', 'fail']);
3237
assert.strictEqual(child.status, 1);
3338
assert.strictEqual(child.signal, null);

0 commit comments

Comments
 (0)