Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/pty-service.yuheard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
}))

vi.mock('node-pty', () => ({ spawn: mocks.spawn }))
vi.mock('fs', async (importOriginal) => {
const actual = await importOriginal<typeof import('fs')>()
return {
...actual,
// GitHub runners do not install Fish. Keep shell discovery out of this
// file: pretend the first POSIX candidate exists so spawn stays Fish.
existsSync: (p: Parameters<typeof actual.existsSync>[0]) =>
String(p) === '/usr/bin/fish' || actual.existsSync(p),
}
})
vi.mock('./yuheard-wrapper', () => ({
bashKeepWrapPrompt: vi.fn((dir: string) => `PATH=${dir}:$PATH`),
codexNotifyArgv: vi.fn(() => ['-c', 'notify=[]']),
Expand Down Expand Up @@ -66,7 +76,7 @@
})

expect(result.ok).toBe(true)
expect(notePaneSpawned).toHaveBeenCalledWith('pane-1', '/tmp')

Check failure on line 79 in src/main/pty-service.yuheard.test.ts

View workflow job for this annotation

GitHub Actions / verify (windows-latest)

src/main/pty-service.yuheard.test.ts > PtyService YuHeard bundle boundary > uses injected server access and statically imported wrappers for a Fish shell

AssertionError: expected "vi.fn()" to be called with arguments: [ 'pane-1', '/tmp' ] Received: 1st vi.fn() call: [ "pane-1", - "/tmp", + "C:\\Users\\runneradmin", ] Number of calls: 1 ❯ src/main/pty-service.yuheard.test.ts:79:29
expect(mocks.installWrapper).toHaveBeenCalledWith(
'pane-1',
['codex', 'claude'],
Expand Down
Loading