Skip to content

Commit

Permalink
chore: fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister committed Feb 22, 2024
1 parent edc728b commit d7fc8c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>((resolve) => {
cp.on("exit", (code) => {
Expand Down
3 changes: 2 additions & 1 deletion test/test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d7fc8c1

Please sign in to comment.