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');