Skip to content
Permalink
Browse files
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>
  • Loading branch information
aduh95 authored and danielleadams committed Jul 26, 2022
1 parent 9c699bd commit 8b0248506f4c314aa65e27d49567e5f04b41c9ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
@@ -114,7 +114,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 }),
child.stdout.toArray({ signal: t.signal }),
child.stderr.toArray({ signal: t.signal }),
@@ -1,5 +1,6 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
const assert = require('assert');
const { spawnSync } = require('child_process');
const { setTimeout } = require('timers/promises');
@@ -28,6 +29,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);

0 comments on commit 8b02485

Please sign in to comment.