vitest plugin: optional custom pool that embeds claude plugin test in Vitest (M7)

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start by checking Vitest 5's custom pool interface in vitest/node and the output from claude plugin test; the issue names no project files or tests to begin with. Write a design document covering API fit, per-test result mapping, granularity, and failure modes, then record the maintainer's decision to build or close. If built, acceptance also requires a ./pool export tested with a fake binary.

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

描述

enhancement help wanted

Problem

The package emulates the Claude Code mod engine in Node. The emulation can only approximate the real engine, and the project keeps two test runners for one test set: Vitest (fast, unit) and claude plugin test (real engine, integration). A mod author runs both and reads two reports.

Proposal

An optional custom Vitest pool that runs claude plugin test inside Vitest, so the same vitest run executes a test file once in the emulation and once against the real engine, with one report and one watch mode.

// vitest.config.ts (sketch)
export default defineConfig({
  test: { pool: "@kwitsch/vitest-plugin-claude-code-mod/pool" },
});

Design points

  • This issue starts with a spec, not code. The feature is optional and only worth a design of its own once there is demand. The first deliverable is a design document that answers the questions below; implementation follows only if the answers hold.
  • Vitest's pool API. Check what Vitest 5 offers for custom pools (vitest/node pool interface) and how stable it is. A pool API change in a major would break the package; the peer range vitest ^5.0.0 is deliberately narrow.
  • Mapping results. claude plugin test prints a text report per file. A pool needs per-test results with names, durations and failure messages. Check whether the binary has a machine-readable output; if it only prints text, parsing it is a drift risk of its own.
  • Granularity. The binary runs a plugin directory, not a single test file, and has 5 s per test with no control over parallelism. A pool that maps one Vitest file to one binary run may be slow or flaky.
  • What it must not replace. The integration run before a release cannot be replaced by the package. A pool is a convenience for local work, not a gate.
  • Demand. Record who asks for it and what the two-report workflow costs today before building it.

Scope

  • Design document in the issue or in docs/: Vitest pool API fit, result mapping, granularity, failure modes.
  • Decision to build or close.
  • If built: a ./pool export, tests with a fake binary, README section. A new subpath is a minor change.

Acceptance

  • A design document (in docs/ or this issue) answers the questions under Design points and ends with the maintainer's decision to build or close.
  • If built: the ./pool export passes its tests with a fake binary.

Relations

  • Originating PR: #31
  • Depends on: #34
主要语言
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 摘要。