Testing Overview
This project uses different testing frameworks for each package within the monorepo. This section guides you through running tests across the entire project or focusing on specific packages.
Running All Tests
From the repository root, run tests across all packages:
npm run test
For coverage reports across all packages:
npm run test:coverage
Backend Testing
The backend (NestJS) uses Jest as the testing framework.
- Unit Tests: Run
npm run testin thebackend/folder - End-to-End Tests: Run
npm run test:e2eto test API integration - Coverage Reports: Available in
backend/coverage/lcov-report/
For detailed instructions, see Backend Testing.
Frontend Testing
The frontend (Nuxt + Vue) uses Vitest for unit testing.
- Unit Tests: Run
npm run testin thefrontend/folder - Coverage Reports: Available in
frontend/coverage/
For detailed instructions, see Frontend Testing.
Coverage Reports
After running tests with coverage, HTML reports are generated:
- Backend:
backend/coverage/lcov-report/index.html - Frontend:
frontend/coverage/lcov-report/index.html
Open these in a browser to view detailed coverage metrics.
Some code is exlcuded from the coverage due to some files not needing tests (database queries, modules, main, etc.)
To remove a file from coverage, put them in the corresponding files:
- Backend:
backend/jest.config.ts, add path to listcoveragePathIgnorePatterns - Frontend:
frontend/vitest.config.ts, add path to listcoverage.exclude