Skip to content

Commit 3fd474c

Browse files
Brooooooklynclaude
andcommitted
test(cli): mock execFile in auth-login (openBrowser no longer uses exec)
openBrowser switched from exec to execFile in 7d8fc59, but the node:child_process mock still only exported `exec`, so runLogin's import of execFile failed under vitest. Export execFile from the mock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 89365bb commit 3fd474c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/void/test/unit/auth-login.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
22
import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test';
33
import { runLogin } from '../../src/cli/auth.ts';
44

5-
const mockExec = vi.fn();
5+
const mockExecFile = vi.fn();
66
const exchangeRequests: Array<{
77
url: string;
88
headers: Record<string, string>;
@@ -20,11 +20,11 @@ function codeChallengeFor(verifier: string): string {
2020
}
2121

2222
vi.mock('node:child_process', () => ({
23-
exec: (...args: Array<unknown>) => mockExec(...args),
23+
execFile: (...args: Array<unknown>) => mockExecFile(...args),
2424
}));
2525

2626
beforeEach(() => {
27-
mockExec.mockReset();
27+
mockExecFile.mockReset();
2828
exchangeRequests.length = 0;
2929
process.env.VOID_API_URL = 'https://api.test';
3030

0 commit comments

Comments
 (0)