From d337cbc19f12159014fda24cef22e0e02f7a9314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 4 May 2022 17:23:08 +0200 Subject: [PATCH] Run `mocha` using `process.execPath` instead of harcoding `"node"` (#48797) --- scripts/build/tests.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build/tests.js b/scripts/build/tests.js index 10c6db79cf1..84cd23bfc10 100644 --- a/scripts/build/tests.js +++ b/scripts/build/tests.js @@ -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}.`);