- Introduced coding standards for TypeScript and React in SKILL.md. - Added continuous learning skill with configuration and evaluation scripts. - Created detail layout guidelines for read-only pages. - Established form layout rules for data-entry forms. - Documented project guidelines for the frontend monorepo. - Implemented security review checklist for frontend/Electron applications. - Developed a verification loop skill for comprehensive session checks. This commit enhances the skill set available for developers, ensuring adherence to best practices and improving code quality.
41 lines
1.4 KiB
Plaintext
41 lines
1.4 KiB
Plaintext
---
|
|
description: TDD workflow, 80% coverage minimum, Vitest unit tests, and browser journey verification
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Testing Requirements
|
|
|
|
## Minimum Test Coverage: 80%
|
|
|
|
Test types:
|
|
|
|
1. **Unit tests** — pure functions, transformers, validators, stores, utilities (`*.test.ts` / `*.test.tsx`, colocated or `__tests__/`)
|
|
2. **Component tests** — Testing Library in packages that already have it (`packages/ui`, `packages/core-events`)
|
|
3. **App journeys** — browser verification of `apps/web` flows (login, index / form / detail). There is no Playwright or NestJS E2E suite in this repo.
|
|
|
|
Runner: **Vitest**. Root command: `pnpm test`. Per-package: `pnpm --filter <pkg> test`. Also `pnpm typecheck` and `pnpm check:all`.
|
|
|
|
## Test-Driven Development
|
|
|
|
MANDATORY workflow:
|
|
|
|
1. Write test first (RED)
|
|
2. Run test — it should FAIL
|
|
3. Write minimal implementation (GREEN)
|
|
4. Run test — it should PASS
|
|
5. Refactor (IMPROVE)
|
|
6. Verify coverage (80%+)
|
|
|
|
## Troubleshooting Test Failures
|
|
|
|
1. Use **tdd-guide** agent
|
|
2. Check test isolation
|
|
3. Verify mocks are correct (`@repo/core-api` services, HTTP client — not a database)
|
|
4. Fix implementation, not tests (unless tests are wrong)
|
|
|
|
## Agent Support
|
|
|
|
- **tdd-guide** — Use PROACTIVELY for new features, enforces write-tests-first
|
|
- **e2e-runner** — Frontend journeys: Vitest + Testing Library, plus browser verification for `apps/web`
|
|
- Skill: `.agents/skills/tdd-workflow/`
|