---
globs:
  - "**/*.test.ts"
  - "**/*.spec.ts"
  - "src/**/*.ts"
---

# Testing Standards

- **Placement:** Tests next to source files with `.test.ts` suffix
- **Coverage:** Core logic >90%, CLI >70%, Git ops >80%
- **Fixtures:** In `test/fixtures/` (events, state samples)
- **Mocking:** Mock externals (git, fs, network) with `jest.mock()`
- **Structure:** `describe` for groups, `it` for cases, always `await` async ops
- **Cleanup:** `beforeEach`/`afterEach` with temp dirs, `rimraf` after
- **Run:** `npm test` / `npm run test:coverage`
