This monorepo uses Vitest as the primary testing framework, configured for optimal performance and developer experience across all packages and applications.
# Run all tests across the monorepo
pnpm test:projects
# Watch mode for all tests
pnpm test:projects:watch
# Run tests for a specific package
cd apps/backend/order
pnpm test
# Run tests with coverage
pnpm test -- --coverage
# Open Vitest UI
pnpm test -- --ui
Tests are integrated into the Turborepo pipeline:
{
"test": {
"inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/vitest.config.ts"],
"dependsOn": ["transit", "@repo/vitest#build"],
"outputs": ["coverage.json"]
}
}
This ensures:
The monorepo includes scripts for collecting coverage from all packages:
# Collect coverage reports from all packages
pnpm turbo test
# Collect and merge coverage reports
cd tooling/vitest
pnpm collect-json-reports
pnpm merge-json-reports
pnpm report
scripts/collect-json-outputs.ts
)Automatically discovers and collects coverage.json
files from:
apps/backend/*
- Backend applicationsapps/frontend/*
- Frontend applications