test: restore codex hook cleanup warn spy

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-05-31 01:53:24 -07:00
committed by Neil
co-authored by Orca
parent cb136952c9
commit 61cee02438
+9 -5
View File
@@ -687,12 +687,16 @@ describe('CodexHookService', () => {
)
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {})
expect(new CodexHookService().install().state).toBe('installed')
try {
expect(new CodexHookService().install().state).toBe('installed')
expect(warnSpy).not.toHaveBeenCalledWith(
'[codex-hook-service] failed to clean legacy Codex hooks',
expect.anything()
)
expect(warnSpy).not.toHaveBeenCalledWith(
'[codex-hook-service] failed to clean legacy Codex hooks',
expect.anything()
)
} finally {
warnSpy.mockRestore()
}
const systemHooks = JSON.parse(readFileSync(systemHooksPath, 'utf-8')) as {
hooks: Record<string, unknown>
}