Testing
Learn about our approach to unit testing, end-to-end scenarios, and test reporting across the platform.
Unit tests – Vitest
We use Vitest as our main testing framework for unit and integration tests.
Tests are colocated with implementation files for better context and maintenance – for example:
src/
├── api/
│ ├── useSecureAxios.ts
│ └── useSecureAxios.test.ts
Features and best practices:
- Testing logic-heavy React hooks using
@testing-library/react
. - API mocking with
axios-mock-adapter
ornock
. - Isolated unit testing using
vi.mock
for external modules. - Descriptive
describe/it
blocks following a clear "Given-When-Then" structure.
Unit tests are executed using the following command:
npm run test
Code coverage is collected via vitest run --coverage
and included in merged reports.
E2E tests – Playwright
End-to-End (E2E) testing is handled via Playwright, focusing on critical user scenarios.
These tests simulate real-world usage and help ensure key workflows are reliable across browsers.
Characteristics:
- Tests are executed in headless Chrome and Edge via Playwright.
- Only core features and critical paths are currently covered.
- Visual reports are automatically generated in HTML after each run.
To run E2E tests locally or in CI:
npm run test:e2e
Test reporting and code coverage
All test runs generate coverage reports using Vitest Coverage (Istanbul) and NYC for merging:
npm run coverage
Merged coverage output is stored in:
coverage/merged/lcov.info
These reports are published automatically via Azure DevOps pipelines using the Cobertura format.