From e91ef3659d2b4cab24c7b795cb94111c5753e906 Mon Sep 17 00:00:00 2001 From: jeffyxu Date: Mon, 15 Jun 2026 10:43:46 +0800 Subject: [PATCH] fix(test): sync hooks-e2e expected counts after PR #28 added MR-hint + TodoWrite-hint hooks PR #28 added: - 1 SessionStart hook (MR hint) - 1 PostToolUse hook (TodoWrite hint to call teamai-recall subagent) hooks.test.ts and other unit tests were updated in PR #28, but hooks-e2e.test.ts was missed, breaking CI on tencent/main. Update expected counts: - SessionStart: 2 -> 3 - PostToolUse: 6 -> 7 - title: "13 hooks" -> "15 hooks" Verified locally: - vitest e2e: hooks-e2e.test.ts 14/14 pass - vitest run: 1356 pass / 4 skip / 0 fail - tsc --noEmit: clean --- src/__tests__/hooks-e2e.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/__tests__/hooks-e2e.test.ts b/src/__tests__/hooks-e2e.test.ts index 098c723..58bd9cd 100644 --- a/src/__tests__/hooks-e2e.test.ts +++ b/src/__tests__/hooks-e2e.test.ts @@ -39,7 +39,7 @@ async function readResult(filePath: string): Promise> { describe('hooks E2E — real file I/O', () => { describe('inject — full injection to temp directories', () => { - it('creates Claude settings.json with all 4 events and 13 hooks', async () => { + it('creates Claude settings.json with all 4 events and 15 hooks', async () => { const p = claudePath(); await injectHooks(p, 'claude'); @@ -47,13 +47,13 @@ describe('hooks E2E — real file I/O', () => { const hooks = result.hooks as Record; expect(Object.keys(hooks)).toEqual(['SessionStart', 'Stop', 'PostToolUse', 'UserPromptSubmit']); - expect(hooks.SessionStart).toHaveLength(2); + expect(hooks.SessionStart).toHaveLength(3); expect(hooks.Stop).toHaveLength(3); - expect(hooks.PostToolUse).toHaveLength(6); + expect(hooks.PostToolUse).toHaveLength(7); expect(hooks.UserPromptSubmit).toHaveLength(2); }); - it('creates Cursor hooks.json with all 4 events and 13 hooks', async () => { + it('creates Cursor hooks.json with all 4 events and 15 hooks', async () => { const p = cursorPath(); await injectHooks(p, 'cursor'); @@ -62,9 +62,9 @@ describe('hooks E2E — real file I/O', () => { const hooks = result.hooks as Record; expect(Object.keys(hooks)).toEqual(['sessionStart', 'stop', 'postToolUse', 'beforeSubmitPrompt']); - expect(hooks.sessionStart).toHaveLength(2); + expect(hooks.sessionStart).toHaveLength(3); expect(hooks.stop).toHaveLength(3); - expect(hooks.postToolUse).toHaveLength(6); + expect(hooks.postToolUse).toHaveLength(7); expect(hooks.beforeSubmitPrompt).toHaveLength(2); });