hook-events.test.ts
This file
Path
packages/agent-kit/test/hook-events.test.ts
28 lines · 792 bytes · TypeScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–28why, one step back1import { describe, expect, it } from "@effect/vitest";2import { Schema } from "effect";34import { claudeEventOf, HookEvent } from "../src/hook-events.ts";56describe("the hook events a harness calls the CLI with", () => {7 it("are the three the generated hooks name", () => {8 expect(HookEvent.literals).toStrictEqual([9 "session-start",10 "pre-tool-use",11 "stop",12 ]);13 });1415 it("each answer one Claude Code hook event", () => {16 expect(17 HookEvent.literals.map((event) => [event, claudeEventOf[event]])18 ).toStrictEqual([19 ["session-start", "SessionStart"],20 ["pre-tool-use", "PreToolUse"],21 ["stop", "Stop"],22 ]);23 });2425 it("refuse any other event name", () => {26 expect(Schema.is(HookEvent)("post-tool-use")).toBeFalsy();27 });28});