diff --git a/lib/internal/main/test_runner.js b/lib/internal/main/test_runner.js index 778ade4..db41695 100644 --- a/lib/internal/main/test_runner.js +++ b/lib/internal/main/test_runner.js @@ -1,4 +1,4 @@ -// https://github.com/nodejs/node/blob/389b7e138e89a339fabe4ad628bf09cd9748f957/lib/internal/main/test_runner.js +// https://github.com/nodejs/node/blob/2fd4c013c221653da2a7921d08fe1aa96aaba504/lib/internal/main/test_runner.js 'use strict' const { ArrayFrom, @@ -116,7 +116,7 @@ function runTestFile (path) { err = error }) - const { 0: { code, signal }, 1: stdout, 2: stderr } = await SafePromiseAll([ + const { 0: { 0: code, 1: signal }, 1: stdout, 2: stderr } = await SafePromiseAll([ once(child, 'exit', { signal: t.signal }), toArray.call(child.stdout, { signal: t.signal }), toArray.call(child.stderr, { signal: t.signal }) diff --git a/test/parallel/test-runner-exit-code.js b/test/parallel/test-runner-exit-code.js index 0d7b65a..7e407ee 100644 --- a/test/parallel/test-runner-exit-code.js +++ b/test/parallel/test-runner-exit-code.js @@ -1,8 +1,9 @@ -// https://github.com/nodejs/node/blob/1523a1817ed9b06fb51c0149451f9ea31bd2756e/test/parallel/test-runner-exit-code.js +// https://github.com/nodejs/node/blob/2fd4c013c221653da2a7921d08fe1aa96aaba504/test/parallel/test-runner-exit-code.js 'use strict' const common = require('../common') +const fixtures = require('../common/fixtures') const assert = require('assert') const { spawnSync } = require('child_process') const { promisify } = require('util') @@ -32,6 +33,10 @@ if (process.argv[2] === 'child') { assert.strictEqual(child.status, 0) assert.strictEqual(child.signal, null) + child = spawnSync(process.execPath, ['--test', fixtures.path('test-runner', 'subdir', 'subdir_test.js')]) + assert.strictEqual(child.status, 0) + assert.strictEqual(child.signal, null) + child = spawnSync(process.execPath, [__filename, 'child', 'fail']) assert.strictEqual(child.status, 1) assert.strictEqual(child.signal, null)