diff --git a/tests/unit/cliproxy/session-tracker-target.test.ts b/tests/unit/cliproxy/session-tracker-target.test.ts index be4257e1..762e1f04 100644 --- a/tests/unit/cliproxy/session-tracker-target.test.ts +++ b/tests/unit/cliproxy/session-tracker-target.test.ts @@ -55,7 +55,7 @@ function runSessionTrackerScenario( const scriptPath = path.join(tempHome, `session-target-child-${Date.now()}.mjs`); fs.writeFileSync(scriptPath, script, 'utf8'); - const result = spawnSync('/bin/bash', ['-lc', `bun ${JSON.stringify(scriptPath)}`], { + const result = spawnSync(process.execPath, [scriptPath], { cwd: REPO_ROOT, env: { ...process.env, @@ -69,7 +69,7 @@ function runSessionTrackerScenario( if (result.status !== 0) { throw new Error( `child session-tracker scenario failed: ${JSON.stringify({ - command: `bun ${scriptPath}`, + command: `${process.execPath} ${scriptPath}`, status: result.status, signal: result.signal, error: result.error?.message ?? null, diff --git a/tests/unit/commands/tokens-command-auth-rotation.test.ts b/tests/unit/commands/tokens-command-auth-rotation.test.ts index 1ef6c716..9692148a 100644 --- a/tests/unit/commands/tokens-command-auth-rotation.test.ts +++ b/tests/unit/commands/tokens-command-auth-rotation.test.ts @@ -45,7 +45,7 @@ function runTokensCommandInChild(tempHome: string, args: string[]) { const scriptPath = path.join(tempHome, `tokens-child-${Date.now()}.mjs`); fs.writeFileSync(scriptPath, script, 'utf8'); - const result = spawnSync('/bin/bash', ['-lc', `bun ${JSON.stringify(scriptPath)}`], { + const result = spawnSync(process.execPath, [scriptPath], { cwd: REPO_ROOT, env: { ...process.env, @@ -60,7 +60,7 @@ function runTokensCommandInChild(tempHome: string, args: string[]) { if (result.status !== 0) { throw new Error( `child tokens command failed: ${JSON.stringify({ - command: `bun ${scriptPath}`, + command: `${process.execPath} ${scriptPath}`, status: result.status, signal: result.signal, error: result.error?.message ?? null,