w-unit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCover the requested behavior with unit tests. Follow (or the stack's test skill) and existing file conventions. Do not chase coverage percentage.
vitest-v5- Read neighboring tests and the test skill. Colocate beside the implementation.
*.test.ts - Test the behavior that can fail: public API, error paths, and the regression this change needs.
- Mock only at documented boundaries. Prefer real types and factories the repo already uses.
- Run the focused file, then the package test script.
- Docs: if behavior or commands changed.
/w-docs
使用单元测试覆盖所要求的行为。遵循 (或该技术栈的测试 skill)以及现有文件约定。不要追求覆盖率百分比。
vitest-v5- 阅读相邻测试和测试 skill。将 与实现文件放在同一目录。
*.test.ts - 测试可能失败的行为:公共 API、错误路径,以及本次变更需要防范的回归。
- 仅在有文档说明的边界处使用 。优先使用真实类型以及仓库已有的 factories。
mock - 先运行聚焦的测试文件,然后运行 package 测试脚本。
- 文档:如果行为或命令发生变化,更新 。
/w-docs