跳到正文

正在自动登录…

← 返回项目列表

joelhooks/mutant-cafe

变异测试

mutant.cafe 是一个针对 Effect TypeScript 的变异测试工具,通过读取类型并生成仍能通过类型检查的变异体,运行相关测试来发现测试未覆盖的缺陷。适用于使用 Effect 框架并希望提升测试质量的开发者。

AI 中文解读 · 根据仓库描述与 README 生成 · 2026/11/4 05:12:09 · 查看原文

值得看TypeScript开发工具
累计 Stars
54
当前热度
1 天内 · 小火
仓库创建时间
打开 GitHub ↗

选用指南

AI 根据 README 整理 · 2026/11/4 05:12:09

适用场景

适用于在 CI 中检查变更代码的变异测试,可通过 --in-diff-range 和 --max-mutants 控制范围,并生成 GitHub 格式的摘要。

查看 README 依据
## CI Use a git range to check changed bodies and a mutant budget to cap the work. The budget applies after file, diff and function selection. Ordering uses repository-relative file path (lexical, not locale-dependent), start line, column, then id. `--max-mutants 0` keeps none. Budget-skipped mutants are not outcomes. This advisory GitHub Actions job writes a step summary and updates one sticky PR comment. Install mutant-cafe as a dev dependency first. Replace `npm ci` with your package manager's install command if needed; run the mutation command from the package you want to test. ```yaml
name: Mutation advisory on: pull_request permissions: contents: read pull-requests: write jobs: mutants: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 24 - run: npm ci - name: Check changed bodies run: >- npx --no-install mutant-cafe --in-diff-range "origin/${{ github.base_ref }}...HEAD" --max-mutants 40 --format github --advisory --summary-md mutant-summary.md
使用方式

通过命令行使用,例如使用 npx mutant-cafe --list 预览变异体,使用 --jobs 指定并行任务数。

查看 README 依据
- `Effect.succeed(value)` for plausible values of `A`, `Effect.fail` of each tag, `Effect.die`, and `Effect.never` behind a measured timeout - `Option.none()` and `Option.some(value)` - `Stream.empty`, a one-element stream, and a failing stream - a `Layer` that dies at build, even when its error type is `never`, plus one failing build per error tag - flipped booleans and cycled literal unions ## Use it Needs Node 24 or later, a `tsconfig.json`, and a vitest suite that passes. ```sh npm install -D mutant-cafe npx mutant-cafe --list # preview the mutants
npx mutant-cafe --jobs 4 # test them ``` It mutates internal functions by default, including `Effect.fn` and `Effect.fnUntraced`, object-literal arrows, service methods inside Layers, and the inner function of a curried export. Layer values and static Layer properties are targets too. Names follow their path, such as `Greeter.layer.greet`, `policy.canEdit`, and `guardFor.<inner>`. With `--exported-only`, targets must be reachable through an exported binding path: exported top-level functions, methods and functions in exported values, returned curried functions, and exported Layers with
部署要求

需要 Node 24 或更高版本,以及一个 tsconfig.json 和通过测试的 vitest 套件。

查看 README 依据
- `Effect.succeed(value)` for plausible values of `A`, `Effect.fail` of each tag, `Effect.die`, and `Effect.never` behind a measured timeout - `Option.none()` and `Option.some(value)` - `Stream.empty`, a one-element stream, and a failing stream - a `Layer` that dies at build, even when its error type is `never`, plus one failing build per error tag - flipped booleans and cycled literal unions ## Use it Needs Node 24 or later, a `tsconfig.json`, and a vitest suite that passes. ```sh npm install -D mutant-cafe npx mutant-cafe --list # preview the mutants
已知限制

不支持 node:test,且仅支持 Vitest 作为测试运行器;对于非 Vitest 运行器,结果会被标记为不可靠。

查看 README 依据
This does not add `node:test` support. Literal relative imports are traced transitively; computed imports remain subject to the full-suite fallback. Selection and partial failures come from Vitest's reporter hooks, not its human-readable messages. A reported failure still counts as caught if another test file hangs.
test` are unverified, not declared non-Vitest. Only an explicit non-Vitest runner skips the baseline and makes all results unreliable. Delegated or unknown scripts and failed selection probes warn but do not disable the Vitest baseline.

README

正在加载 README…

收录信息

仓库创建时间
2026/11/3 11:08:49
首次达标收录
2026/11/4 05:07:35
统计更新时间
2026/11/4 07:11:39

按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。

模型评估

值得看加权总分 4.0 / 5

新颖度
3.9
实用价值
4.2
成熟度
4.4
实质含量
3.6

由 Jev 模型根据仓库描述与 README 评估,2026/11/4 05:07:35 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。

仓库信息

最近推送
2026/11/3 23:50:57
许可证标识
MIT
Fork 数
1
当前状态
未归档

收录记录

按创建时长与累计 Stars 首次收录:小火
首次发现项目