Skip to content
Merged
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
MoLow and aduh95 authored Sep 8, 2022
commit dea4784c8545f8661b12f6f28fd5527914103638
6 changes: 4 additions & 2 deletions test/fixtures/test-runner/run_inspect.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const common = require('../../common');
Comment thread
MoLow marked this conversation as resolved.
const fixtures = require('../../common/fixtures');
const { run } = require('node:test');
Expand Down Expand Up @@ -30,9 +32,9 @@ if (process.env.inspectPort === 'addTwo') {

const stream = run({ files: [fixtures.path('test-runner/run_inspect_assert.js')], inspectPort });
if (expectedError) {
stream.once('test:fail', common.mustCall(({ error }) => {
stream.on('test:fail', common.mustCall(({ error }) => {
assert.deepStrictEqual({ name: error.cause.name, code: error.cause.code }, expectedError);
}));
} else {
stream.once('test:fail', ({ error }) => { throw error; });
stream.on('test:fail', common.mustNotCall());
}
3 changes: 2 additions & 1 deletion test/fixtures/test-runner/run_inspect_assert.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const assert = require('node:assert');
Comment thread
MoLow marked this conversation as resolved.

const { expectedPort, expectedInitialPort, expectedHost } = process.env;
Expand All @@ -15,4 +17,3 @@ if ('expectedInitialPort' in process.env) {
if ('expectedHost' in process.env) {
assert.strictEqual(debugOptions.host, expectedHost);
}
process.exit();