diff --git a/cli/test/helpers/run-cli.ts b/cli/test/helpers/run-cli.ts index 28be2593..c7f784f7 100644 --- a/cli/test/helpers/run-cli.ts +++ b/cli/test/helpers/run-cli.ts @@ -1,4 +1,5 @@ import { existsSync } from 'node:fs' +import { fileURLToPath } from 'node:url' export async function runCli(args: string[], env: Record = {}) { // Use Bun.which() to find bun in PATH, but verify it exists @@ -7,7 +8,7 @@ export async function runCli(args: string[], env: Record = {}) { const proc = Bun.spawn({ cmd: [bunPath, 'src/index.ts', ...args], - cwd: new URL('../../', import.meta.url).pathname, + cwd: fileURLToPath(new URL('../../', import.meta.url)), env: { ...process.env, ...env }, stdout: 'pipe', stderr: 'pipe' diff --git a/cli/test/integration/version-command.test.ts b/cli/test/integration/version-command.test.ts index 838f5e1a..c32851d9 100644 --- a/cli/test/integration/version-command.test.ts +++ b/cli/test/integration/version-command.test.ts @@ -2,6 +2,7 @@ import { describe, expect, test } from 'bun:test' import { mkdtemp, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' +import { fileURLToPath } from 'node:url' import { runCli } from '../helpers/run-cli' describe('version command', () => { @@ -31,7 +32,7 @@ describe('version command', () => { const bunPath = process.execPath const build = Bun.spawn({ cmd: [bunPath, 'build', 'src/index.ts', '--target=node', `--outfile=${outfile}`], - cwd: new URL('../../', import.meta.url).pathname, + cwd: fileURLToPath(new URL('../../', import.meta.url)), stdout: 'pipe', stderr: 'pipe' })