vitest plugin: check turn.complete, session.start and session.end $ answers against claude plugin test

未关闭
#212 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
54/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

Start by reading call() in packages/vitest-plugin-claude-code-mod/src/testing/engine.ts and the existing conformance tests or pnpm test:e2e setup. For each of turn.complete, session.start, and session.end, compare the same stub under the Vitest plugin and claude plugin test, skipping when claude is unavailable. Done when all three tests confirm matching answers and a changeset is added for any behavior change.

由索引模型根据 Issue 内容生成。

描述

enhancement
Problem

#147 fixed tool.call and #211 fixes prompt.submit: the vitest plugin answered a mod's own $.<event> call with { value } / { deny } where claude plugin test takes the event's own result shape. The same check has not been done for the other events with an own result shape that a mod can call on $: turn.complete, session.start, session.end. No test runs the same stub under both runners, so the two can drift again.

Proposal

For each of turn.complete, session.start, session.end: write a minimal mod that calls $.<event>(...), run it under claude plugin test with a stub answering the event's own result shape and with { value }, and record which one passes and what the mod receives. Where the vitest plugin differs, change call() in packages/vitest-plugin-claude-code-mod/src/testing/engine.ts to follow the engine (recommendation: follow the engine strictly, with a BREAKING minor changeset, as #211 did). Add one conformance test per event that uses the same stub under both runners.

Design points

Where a conformance test lives: recommendation is a test in the vitest plugin package that spawns claude plugin test and skips when claude is not on PATH, like pnpm test:e2e.

Package

@kwitsch/vitest-plugin-claude-code-mod

Scope

Only the three events listed; related: #33 (shape validator).

Acceptance
  • For each of turn.complete, session.start, session.end, a mod's own $.<event> call takes the same stub answer under the vitest plugin and under claude plugin test.
  • A test per event exists and passes under both runners.
  • A changeset is added for any behavior change.
Relations
  • Originating PR: #211
主要语言
TypeScript
星标
0
派生
0
平均合并
29 分钟
30 天内合并 PR
138

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kwitsch/claude-code-plugin-tooling 的其他 Issue

查看 kwitsch/claude-code-plugin-tooling 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。