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
12 changes: 6 additions & 6 deletions src/__tests__/hooks-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ async function readResult(filePath: string): Promise<Record<string, unknown>> {

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');

const result = await readResult(p);
const hooks = result.hooks as Record<string, unknown[]>;

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');

Expand All @@ -62,9 +62,9 @@ describe('hooks E2E — real file I/O', () => {
const hooks = result.hooks as Record<string, unknown[]>;

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);
});

Expand Down
Loading