Skip to content

Frontend testing

Tests structure

Base test structure

app/frontend/src/tests/
   ├── tests/<module_name>/  # Tests for a specific module, with the module test structure below
   ├── shared/               # Shared between test modules (fixtures, mocks, stubs, types, utils)

Module test structure

<module_name>/
├── fixtures/  # Test fixtures
├── mocks/     # Test mocks
├── stubs/     # Test stubs
├── tests/     # Unit and integration tests, may be split into folders mirroring the module structure
├── types/     # TypeScript interfaces & types & enums, typically enum with tests selectors
├── utils/     # Utility functions for tests

Frontend tests

Frontend tests use Vitest. Run them from the repository root:

yarn test

# with coverage
yarn test:coverage