diff --git a/src/utils.ts b/src/utils.ts index 6751d40..6c66416 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -142,7 +142,7 @@ export function prettyTime(diff: number) { } export async function exec(cmd: string, args: string[], cwd: string) { - const cp = spawn(cmd, args, { stdio: "inherit", cwd }); + const cp = spawn(cmd, args, { stdio: "inherit", cwd, shell: true }); return new Promise((resolve) => { cp.on("exit", (code) => { diff --git a/test/test_utils.ts b/test/test_utils.ts index d8b883a..8193622 100644 --- a/test/test_utils.ts +++ b/test/test_utils.ts @@ -15,7 +15,8 @@ export interface PkgJson { export async function runJsr(args: string[], cwd: string) { const bin = path.join(__dirname, "..", "src", "bin.ts"); - return await exec("npx", ["ts-node", bin, ...args], cwd); + const tsNode = path.join(__dirname, "..", "node_modules", ".bin", "ts-node"); + return await exec(tsNode, [bin, ...args], cwd); } export async function withTempEnv(