This project is a TypeScript sample workspace prepared for a SpecKit-style testing lab.
It demonstrates the full flow below:
- configure testing principles in the constitution
- generate test tasks from feature specs
- implement code and tests with a TDD workflow
- validate results with typecheck, lint, tests, and coverage
- TypeScript 5
- Jest + ts-jest
- ESLint 9
- Node.js + npm
.
|- .specify/memory/constitution.md
|- specs/001-user-auth/spec.md
|- specs/002-password-change/spec.md
|- specs/003-user-profile/spec.md
|- specs/001-user-auth/tasks.md
|- specs/002-password-change/tasks.md
|- specs/003-user-profile/tasks.md
|- src/auth/
|- tests/unit/auth/
|- tests/integration/auth/
|- tests/e2e/auth/
|- LAB-07-EXECUTION-CHECKLIST.md
|- stryker.config.json
Features: user authentication, password change, user profile lookup
- email validation
- password strength validation
- registration flow
- login flow
- password change flow
- profile lookup flow
- deterministic auth error codes
- in-memory repository for testable integration flow
The project follows the testing constitution in .specify/memory/constitution.md.
Key rules:
- TDD: RED -> GREEN -> REFACTOR
- Testing pyramid: ~70% unit, ~20% integration, ~10% E2E
- AAA test structure
- independent tests with
beforeEach - meaningful assertions only
- no testing of private internals
Install dependencies:
npm installRun typecheck:
npm run typecheckRun lint:
npm run lintRun all tests:
npm testRun unit tests only:
npm run test:unitRun integration tests only:
npm run test:integrationRun E2E tests only:
npm run test:e2eGenerate coverage:
npm run test:coverageRun mutation testing:
npm run test:mutationValidated after implementing all three features:
- typecheck passes
- lint passes
- tests pass
- coverage exceeds constitution targets
- mutation testing runs successfully with Stryker
Measured coverage:
- line coverage: 96.84%
- branch coverage: 95%
Measured mutation score:
- total mutation score: 86.25%
- HTML report:
reports/mutation/mutation.html
- Feature spec: specs/001-user-auth/spec.md
- Generated tasks: specs/001-user-auth/tasks.md
- Feature spec: specs/002-password-change/spec.md
- Generated tasks: specs/002-password-change/tasks.md
- Feature spec: specs/003-user-profile/spec.md
- Generated tasks: specs/003-user-profile/tasks.md
- Lab guide: LAB-07-EXECUTION-CHECKLIST.md
test:mutationnow uses stryker.config.json with the Jest runner plugin for this TypeScript workspace.- The current E2E layer is implemented as a high-level flow test with Jest inside this sample workspace.