Appearance
Frontend Testing
Unit tests
We use Vitest: a fast, modern Jest alternative. Please put Vitest files next to the JS file you test, with the same name and the .test.js extension. Example:
text
├─ ./resources/js/components/
├─ tocContainer.js
└─ tocContainer.test.jsRunning unit tests
sh
npm run test:unitCI/CD integration
JS unit tests are integrated to CI/CD pipeline as a blocking step.
End-to-end tests
We use Cypress for end-to-end tests, but do not have any tests at this moment (late 2024). Tests directory: tests/js.
Cypress is a tool of our choice (e.g., over Laravel Dusk) because it does not limit front-end developers to PHP.
Running end-to-end tests
sh
npm run test:browsersh
npm run cypressVisual regression tests
Not implemented yet (but will be nice to have).