-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tests): integrate Vitest and React Testing Library #2076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'apprécie vraiment cette initiative d'ajouter des tests unitaires sur le frontend 🎉. C'est quelque chose qui, à mon avis, manquait à ce projet. Je vais aussi étudier attentivement les références documentaires que tu as fournies dans la description.
L'exécution de tests unitaires sur le frontend nécessite généralement de simuler les réponses des endpoints d'API. Il faut veiller à structurer ces mocks de manière logique (en général, on utilise l'arborescence dictée par les routes URL). Attention, cela peut vite devenir très chronophage !
cfd0951
to
68238fe
Compare
Added a simple test to allow the |
… `MUI` providers
c96f574
to
1cfeb8b
Compare
Pull Request Description
Summary
This pull request enhances the CI pipeline by integrating Vitest for running unit tests and React Testing Library (RTL) with jsdom for DOM testing.
Changes Included
Installed Vitest for unit testing
package.json
to use Vitest.Installed React Testing Library and jsdom for DOM testing
Configured test scripts in
package.json
Updated GitHub Actions workflow to include test steps
npm-test
job to include steps for running Vitest tests.How to Test
Local Testing
npm install
to install the new dependencies.npm test
to ensure Vitest and RTL run correctly and all tests pass.CI Testing
npm-test
job completes without errors and that all tests pass.Ressources:
Vitest
React Testing Library (RTL)
Jsdom