Skip to content

Commit 073fa85

Browse files
committed
doc(contributing): add end-to-end tests explanations
1 parent 616257d commit 073fa85

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

CONTRIBUTING.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ the various packages, please execute the following:
2828
make init
2929
```
3030

31-
> please note that it will take a while as this project uses a lot of dependencies…'
31+
> please note that it will take a while as this project uses a lot of dependencies…
3232
3333
### Windows
3434

35-
If you want to build this project on Windows, it is recommended to use either WSL 2, or Git bash + `choco install make`.
35+
If you want to build this project on Windows, it is recommended to use either WSL 2,
36+
or Git bash + `choco install make`.
3637

3738
## Development
3839

@@ -77,6 +78,13 @@ You can also build the packages without running a watcher, you have two options:
7778

7879
### Testing
7980

81+
#### Unit tests
82+
83+
Unit tests for each package are located in the `packages/<pkg>/tests` folder, we're using jest
84+
as a test running and `react-test-renderer` as a testing library, some tests are still using
85+
`enzyme`, but this lib is not maintained anymore and doesn't support newer versions of React,
86+
so those should eventually be migrated.
87+
8088
To run unit tests on all packages, run the following command:
8189

8290
```
@@ -92,6 +100,14 @@ make pkg-test-bar
92100

93101
where `bar` is the name of the targeted nivo package.
94102

103+
#### End-to-end tests
104+
105+
Sometimes it's difficult to test certain things in unit tests, from our experience, animations
106+
and interactions can be tricky to test via unit tests only, so we also try to have end-to-end tests.
107+
108+
We're using `cypress` for writing such tests, and those are located in the `cypress/src/components`
109+
folder, as we introduced end-to-end tests later, not all packages have some.
110+
95111
### Formatting
96112

97113
Nivo uses prettier in order to provide a consistent code style.

0 commit comments

Comments
 (0)