Skip to content

Unit tests

This project uses vitest to run unit tests. Please have a look at the current standard for naming and the location of this test on the standards page.

Running locally

Use the following command to get the unit tests running with a watch on the files changed.

sh
$ npm run test:dev

Code coverage (text output)

This command will show you code coverage details in your terminal, this will rerun for any change detected in .test.ts files. You will also get errors when the unit tests fail.

vitest text result

Vitest UI

This command also launches the UI for vitest, otherwise open your browser to http://localhost:3001/vitest/#/

vitest UI

This UI is just a prettier version of the text output. One of the nice features is that you can view a code coverage report within it, see the next page.

Released under the GNU General Public License v3.0.