Unit testing is handled by React Testing Library and Vitest while End-to-End (E2E) Testing is conducted by Playwright.
If you'd like to run all tests, Unit and E2E alike, execute the following command:
pnpm run test
When running unit test scripts, it is assumed that unit tests will be colocated with the source files. Take a look at the placeholder README file in src/components for an example.
If you'd like to execute unit tests specifically, the below command will execute vitest:
pnpm run test:unit
If instead you are interested in coverage reporting, run:
pnpm run test:unit:coverage
All unit tests run in watch mode by default. If you'd like to disable watch mode, change the package.json test scripts with the following
before:
"scripts": {
"test:unit": "vitest unit",
"test:unit:coverage": "vitest --coverage unit"
}