node/test/fixtures/test-runner/run_inspect_assert.js
Moshe Atlow a165193c5c
test_runner: support using --inspect with --test
PR-URL: https://github.com/nodejs/node/pull/44520
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-09-10 17:01:42 +00:00

20 lines
514 B
JavaScript

'use strict';
const assert = require('node:assert');
const { expectedPort, expectedInitialPort, expectedHost } = process.env;
const debugOptions =
require('internal/options').getOptionValue('--inspect-port');
if ('expectedPort' in process.env) {
assert.strictEqual(process.debugPort, +expectedPort);
}
if ('expectedInitialPort' in process.env) {
assert.strictEqual(debugOptions.port, +expectedInitialPort);
}
if ('expectedHost' in process.env) {
assert.strictEqual(debugOptions.host, expectedHost);
}