Skip to content

Commit 41c0c3a

Browse files
committed
test_runner: do not report an error when tests are passing
PR-URL: nodejs/node#43919 Reviewed-By: Mestery <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> (cherry picked from commit 2fd4c013c221653da2a7921d08fe1aa96aaba504)
1 parent 558abfc commit 41c0c3a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/internal/main/test_runner.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// https://github.com/nodejs/node/blob/389b7e138e89a339fabe4ad628bf09cd9748f957/lib/internal/main/test_runner.js
1+
// https://github.com/nodejs/node/blob/2fd4c013c221653da2a7921d08fe1aa96aaba504/lib/internal/main/test_runner.js
22
'use strict'
33
const {
44
ArrayFrom,
@@ -116,7 +116,7 @@ function runTestFile (path) {
116116
err = error
117117
})
118118

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

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// https://github.com/nodejs/node/blob/1523a1817ed9b06fb51c0149451f9ea31bd2756e/test/parallel/test-runner-exit-code.js
1+
// https://github.com/nodejs/node/blob/2fd4c013c221653da2a7921d08fe1aa96aaba504/test/parallel/test-runner-exit-code.js
22

33
'use strict'
44

55
const common = require('../common')
6+
const fixtures = require('../common/fixtures')
67
const assert = require('assert')
78
const { spawnSync } = require('child_process')
89
const { promisify } = require('util')
@@ -32,6 +33,10 @@ if (process.argv[2] === 'child') {
3233
assert.strictEqual(child.status, 0)
3334
assert.strictEqual(child.signal, null)
3435

36+
child = spawnSync(process.execPath, ['--test', fixtures.path('test-runner', 'subdir', 'subdir_test.js')])
37+
assert.strictEqual(child.status, 0)
38+
assert.strictEqual(child.signal, null)
39+
3540
child = spawnSync(process.execPath, [__filename, 'child', 'fail'])
3641
assert.strictEqual(child.status, 1)
3742
assert.strictEqual(child.signal, null)

0 commit comments

Comments
 (0)