Generate a comprehensive Vitest test file for the source module: {{args}}
Rules:
- •Read the source module fully before writing any tests
- •Place test at
<same-dir>/__tests__/<filename>.test.ts - •Import
describe,it,expect,vifromvitest - •Use
vi.mockfor external modules (simple-git, fs, path, chalk) - •Check for a
fixtures.tsin the same__tests__/directory and reuse its helpers - •Cover happy path, edge cases, error branches, and boundary values
- •Follow ESLint conventions:
- •
import typefor type-only imports - •
Array<T>notT[] - •No
interface; usetype - •Boolean variable prefixes (is/has/can/should/will/did)
- •PascalCase type names; single-letter generics (
T,K,V) - •No
forloops orforEach; use.map,.filter,.reduce, or other array methods
- •
- •Add JSDoc comments (with
@paramand@returns) to any helper functions you create in the test file - •Run
npm run test:coverageafter writing to verify thresholds (75% lines/functions/statements, 70% branches)