Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove a snapshot blob from test-inspect-address-in-use.js #45132

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/parallel/test-inspect-address-in-use.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ common.skipIfInspectorDisabled();
const { spawnSync } = require('child_process');
const { createServer } = require('http');
const assert = require('assert');
const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const entry = fixtures.path('empty.js');
const { Worker } = require('worker_threads');
Expand All @@ -21,10 +22,10 @@ function testOnServerListen(fn) {
server.listen(0, '127.0.0.1');
}

function testChildProcess(getArgs, exitCode) {
function testChildProcess(getArgs, exitCode, options) {
testOnServerListen((server) => {
const { port } = server.address();
const child = spawnSync(process.execPath, getArgs(port));
const child = spawnSync(process.execPath, getArgs(port), options);
const stderr = child.stderr.toString().trim();
const stdout = child.stdout.toString().trim();
console.log('[STDERR]');
Expand All @@ -40,8 +41,12 @@ function testChildProcess(getArgs, exitCode) {
});
}

tmpdir.refresh();

testChildProcess(
(port) => [`--inspect=${port}`, '--build-snapshot', entry], 0);
(port) => [`--inspect=${port}`, '--build-snapshot', entry], 0,
{ cwd: tmpdir.path });

testChildProcess(
(port) => [`--inspect=${port}`, entry], 0);

Expand Down