From 7f5291d783b4fea9c01ff8dd13bf6dddeb2749e1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 6 Dec 2023 03:28:17 +0900 Subject: [PATCH] test: resolve path of embedtest binary correctly PR-URL: https://github.com/nodejs/node/pull/50276 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Yagiz Nizipli --- test/embedding/test-embedding.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/embedding/test-embedding.js b/test/embedding/test-embedding.js index 1fb3bc73f494cb..558ccaee47ff0f 100644 --- a/test/embedding/test-embedding.js +++ b/test/embedding/test-embedding.js @@ -14,12 +14,11 @@ tmpdir.refresh(); common.allowGlobals(global.require); common.allowGlobals(global.embedVars); -function resolveBuiltBinary(bin) { - let binary = `out/${common.buildType}/${bin}`; +function resolveBuiltBinary(binary) { if (common.isWindows) { binary += '.exe'; } - return path.resolve(__dirname, '..', '..', binary); + return path.join(path.dirname(process.execPath), binary); } const binary = resolveBuiltBinary('embedtest');