Writing unit, integration, and end-to-end tests

In this boilerplate, Jest is used for unit tests and Playwright for integration and end-to-end tests.

Write unit tests with Jest

To get started with writing unit tests, check out this tutorial from Jest: https://jestjs.io/docs/tutorial-react.

You can also find example tests in the __test__ directory. To add more tests, create a new file in the __test__ directory and add your test code.

To run tests locally, run the following command:

npm run test:ci

Write integration tests with Playwright

To get started with writing integration tests, check out this documentation from Playwright: https://playwright.dev/docs/writing-tests.

You can also find example end-to-end tests in the e2e directory. To add more tests, create a new file in the e2e directory and add your test code.

To run tests locally, run the following command:

npm run test:e2e

For an insightful perspective on testing implementation details, check out this article by Kent C. Dodds: https://kentcdodds.com/blog/testing-implementation-details

Last updated: