You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* first part of transition
* second part of transition
* remove jest
* bump up node version and playwright version
* update all screenshots because of the new playwright version
* fix tests
* one more screenshot update
Copy file name to clipboardExpand all lines: docs/CONTRIBUTING.md
+6-9Lines changed: 6 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ We are using following technology stack in the project
47
47
- [Next.js](https://nextjs.org/) as application framework
48
48
- [Chakra](https://chakra-ui.com/) as component library; our theme customization can be found in `/theme` folder
49
49
- [TanStack Query](https://tanstack.com/query/v4/docs/react/overview/) for fetching, caching and updating data from the API
50
-
- [Jest](https://jestjs.io/) as JavaScript testing framework
50
+
- [Vitest](https://vitest.dev/) as JavaScript testing framework
51
51
- [Playwright](https://playwright.dev/) as a tool for components visual testing
52
52
53
53
And of course our premier language is [Typescript](https://www.typescriptlang.org/).
@@ -119,13 +119,13 @@ These are the steps that you have to follow to make everything work:
119
119
120
120
Every feature or bugfix should be accompanied by tests, either unit tests or component visual tests, or both, except from trivial fixes (for example, typo fix). All commands for running tests you can find [below](./CONTRIBUTING.md#command-list).
121
121
122
-
### Jest unit tests
122
+
### Vitest unit tests
123
123
124
-
If your changes are only related to the logic of the app and not to its visual presentation, then try to write unit tests using [Jest](https://jestjs.io/) framework and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/). In general these tests are "cheaper" and faster than Playwright ones. Use them for testing your utilities and React hooks, as well as the whole components logic.
124
+
If your changes are only related to the logic of the app and not to its visual presentation, then try to write unit tests using [Vitest](https://vitest.dev/) framework and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/). In general these tests are "cheaper" and faster than Playwright ones. Use them for testing your utilities and React hooks, as well as the whole components logic.
125
125
126
-
Place your test suites in `.test.ts` or `.test.tsx` files. You can find or add some mocks or other helpful utilities for these tests purposes in the `/jest` folder.
126
+
Place your test suites in `.spec.ts` or `.spec.tsx` files. You can find or add some mocks or other helpful utilities for these tests purposes in the `/vitest` folder.
127
127
128
-
*Note*, that we are using custom renderer and wrapper in all tests for React components, so please do not import package `@testing-library/react` directly in your test suites, instead use imports from `jest/lib` utility.
128
+
*Note*, that we are using custom renderer and wrapper in all tests for React components, so please do not import package `@testing-library/react` directly in your test suites, instead use imports from `vitest/lib` utility.
129
129
130
130
### Playwright components tests
131
131
@@ -198,8 +198,7 @@ We have 3 pre-configured projects. You can run your test with the desired projec
198
198
|`yarn svg:format`| format and optimize SVG icons in the `/icons` folder using SVGO tool |
|`yarn test:jest:watch`| run all Jest unit tests in watch mode |
201
+
|`yarn test:vitest`| run all Vitest unit tests |
203
202
|`yarn test:pw:local`| run Playwright component tests locally |
204
203
|`yarn test:pw:docker`| run Playwright component tests in docker container |
205
204
|`yarn test:pw:ci`| run Playwright component tests in CI |
@@ -214,6 +213,4 @@ We have 3 pre-configured projects. You can run your test with the desired projec
214
213
215
214
There are some predefined tasks for all commands described above. You can see the full list by pressing <kbd>cmd + shift + P</kbd> and using command`Task: Run task`
216
215
217
-
Also there is a Jest test launch configuration fordebugging and running current test filein the watch mode.
218
-
219
216
And you may find the Dev Container setup useful too.
0 commit comments