Run mocha using process.execPath instead of harcoding "node" (#48797)

This commit is contained in:
Mateusz Burzyński 2022-05-04 17:23:08 +02:00 committed by GitHub
parent ad2b7a6d31
commit d337cbc19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,9 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
try {
setNodeEnvToDevelopment();
const { exitCode } = await exec("node", args, { cancelToken });
const { exitCode } = await exec(process.execPath, args, {
cancelToken,
});
if (exitCode !== 0) {
errorStatus = exitCode;
error = new Error(`Process exited with status code ${errorStatus}.`);