Testing workflow
AlignTrue uses Vitest for unit and integration tests. All contributions must include tests.
Running tests
Run all tests:
pnpm testRun tests for a specific package:
pnpm --filter @aligntrue/core testWatch mode:
pnpm test --watchTest structure
Tests mirror source structure:
packages/core/
├── src/
│ └── bundle.ts
└── tests/
└── bundle.test.tsWriting tests
Follow TDD workflow:
- Write failing test
- Implement feature
- Verify test passes
- Refactor
See .cursor/rules/tdd.mdc for detailed TDD workflow.
Test quality
- Cover edge cases and error paths
- Test determinism for exports
- Use explicit assertions
- Keep tests fast (<3 minutes total suite)
Coverage
Target 80%+ coverage for new features. Check coverage:
pnpm test --coverageLast updated on