Skip to content

Commit

Permalink
test: fix spawnSyncAndExitWithoutError
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Mar 18, 2024
1 parent 454d080 commit dbd8884
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/common/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function spawnSyncAndExit(...args) {
}

function spawnSyncAndExitWithoutError(...args) {
const spawnArgs = args.slice(0, args.length);
const spawnArgs = args.slice(0, args.length - 1);
const expectations = args[args.length - 1];
const child = spawnSync(...spawnArgs);
return expectSyncExit(child, {
Expand Down
2 changes: 1 addition & 1 deletion test/common/sea.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function generateSEA(targetExecutable, sourceExecutable, seaBlob, verifyWorkflow
seaBlob,
'--sentinel-fuse', 'NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2',
...process.platform === 'darwin' ? [ '--macho-segment-name', 'NODE_SEA' ] : [],
]);
], undefined);
} catch (e) {
const message = `Cannot inject ${seaBlob} into ${targetExecutable}: ${inspect(e)}`;
if (verifyWorkflow) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-snapshot-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const entry = fixtures.path('snapshot', 'v8-startup-snapshot-api.js');
'entry.js',
], {
cwd: tmpdir.path
});
}, undefined);
const stats = fs.statSync(tmpdir.resolve('snapshot.blob'));
assert(stats.isFile());
}
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-snapshot-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (!process.config.variables.node_use_node_snapshot) {
snapshotScript,
], {
cwd: tmpdir.path
});
}, undefined);
const stats = fs.statSync(tmpdir.resolve('snapshot.blob'));
assert(stats.isFile());
}
Expand All @@ -58,7 +58,7 @@ const blobPath = tmpdir.resolve('my-snapshot.blob');
snapshotScript,
], {
cwd: tmpdir.path
});
}, undefined);
const stats = fs.statSync(blobPath);
assert(stats.isFile());
}
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-snapshot-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function filterCoverageFiles(name) {
NODE_V8_COVERAGE: tmpdir.path,
NODE_DEBUG_NATIVE: 'inspector_profiler',
}
});
}, undefined);
const files = fs.readdirSync(tmpdir.path);
console.log('Files in tmpdir.path', files); // Log for debugging the test.
const coverage = files.filter(filterCoverageFiles);
Expand All @@ -52,7 +52,7 @@ function filterCoverageFiles(name) {
NODE_V8_COVERAGE: tmpdir.path,
NODE_DEBUG_NATIVE: 'inspector_profiler',
},
});
}, undefined);
const files = fs.readdirSync(tmpdir.path);
console.log('Files in tmpdir.path', files); // Log for debugging the test.
const coverage = files.filter(filterCoverageFiles);
Expand Down
3 changes: 2 additions & 1 deletion test/sequential/test-single-executable-application-empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ writeFileSync(configFile, `
spawnSyncAndExitWithoutError(
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{ cwd: tmpdir.path });
{ cwd: tmpdir.path },
undefined);

assert(existsSync(seaPrepBlob));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ spawnSyncAndExitWithoutError(
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
});
},
undefined);

assert(existsSync(seaPrepBlob));

Expand Down

0 comments on commit dbd8884

Please sign in to comment.