Agent Skills
› UsefulSoftwareCo/executor
› wrdn-effect-vitest-tests
wrdn-effect-vitest-tests
GitHub指导在仓库中使用@effect/vitest进行确定性测试。禁止从原始vitest导入,严禁将断言置于条件分支后,需拆分逻辑或显式断言,确保测试符合Effect范式且行为确定。
触发场景
代码审查发现使用了原始vitest导入
检测到expect调用位于if、三元或switch等条件分支内部
安装
npx skills add UsefulSoftwareCo/executor --skill wrdn-effect-vitest-tests -g -y
SKILL.md
Frontmatter
{
"name": "wrdn-effect-vitest-tests",
"description": "Keep tests deterministic and Effect-aware. Use when lint flags direct vitest imports or conditional assertions inside tests.",
"allowed-tools": "Read Grep Glob Bash"
}
Use @effect/vitest for tests in this repo.
Fix Shape
- Import
describe,it,expect, and helpers from@effect/vitest. - Import utility helpers from
@effect/vitest/utilswhen needed. - Do not import from raw
vitestexcept in config or tooling files. - Do not put
expect(...)behindif, ternary, logical, or switch branches. - Split conditional behavior into separate tests, or assert the branch condition and expected value explicitly.
Bad
if (result.ok) {
expect(result.value).toBe("x");
}
Good
expect(result).toEqual({ ok: true, value: "x" });
版本历史
- fd4fb02 当前 2026-07-05 10:55


