Skip to content
Prev Previous commit
Next Next commit
fixup! test: add escapePOSIXShell util
  • Loading branch information
aduh95 committed Sep 27, 2024
commit 779d566c9e32d900edfbf3f69c182b2a0d0b7a97
14 changes: 7 additions & 7 deletions test/parallel/test-cli-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ child.exec(...common.escapePOSIXShell`"${process.execPath}" --eval "console.erro

// Assert that module loading works.
{
child.exec(...common.escapePOSIXShell`"${process.execPath}" --eval "${`require(${JSON.stringify(__filename)})`}"`,
common.mustCall((err, stdout, stderr) => {
assert.strictEqual(err.code, 42);
assert.strictEqual(
stdout, 'Loaded as a module, exiting with status code 42.\n');
assert.strictEqual(stderr, '');
}));
common.spawnPromisified(process.execPath, ['--eval', `require(${JSON.stringify(__filename)})`])
.then(common.mustCall(({ stdout, stderr, code }) => {
assert.strictEqual(stderr, '');
assert.strictEqual(
stdout, 'Loaded as a module, exiting with status code 42.\n');
assert.strictEqual(code, 42);
}))
}

// Check that builtin modules are pre-defined.
Expand Down