Skip to content

Commit

Permalink
fixup! test: do not assume process.execPath contains no spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Sep 20, 2024
1 parent 6a3f643 commit 2ea4fa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/sequential/test-cli-syntax-file-not-found.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const fixtures = require('../common/fixtures');
// The execPath might contain chars that should be escaped in a shell context.
// On non-Windows, we can pass the path via the env; `"` is not a valid char on
// Windows, so we can simply pass the path.
const execNode = (flag, file) => exec(
const execNode = (flag, file, callback) => exec(
`"${common.isWindows ? process.execPath : '$NODE'}" ${flag} "${common.isWindows ? file : '$FILE'}"`,
common.isWindows ? undefined : { env: { ...process.env, NODE: process.execPath, FILE: file } },
callback,
);

// Test both sets of arguments that check syntax
Expand Down
3 changes: 2 additions & 1 deletion test/sequential/test-cli-syntax-good.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const fixtures = require('../common/fixtures');
// The execPath might contain chars that should be escaped in a shell context.
// On non-Windows, we can pass the path via the env; `"` is not a valid char on
// Windows, so we can simply pass the path.
const execNode = (flag, file) => exec(
const execNode = (flag, file, callback) => exec(
`"${common.isWindows ? process.execPath : '$NODE'}" ${flag} "${common.isWindows ? file : '$FILE'}"`,
common.isWindows ? undefined : { env: { ...process.env, NODE: process.execPath, FILE: file } },
callback,
);

// Test both sets of arguments that check syntax
Expand Down

0 comments on commit 2ea4fa0

Please sign in to comment.