Skip to content

Commit

Permalink
doc(contributing): add end-to-end tests explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed May 12, 2024
1 parent 616257d commit 073fa85
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ the various packages, please execute the following:
make init
```

> please note that it will take a while as this project uses a lot of dependencies…'
> please note that it will take a while as this project uses a lot of dependencies…
### Windows

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

## Development

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

### Testing

#### Unit tests

Unit tests for each package are located in the `packages/<pkg>/tests` folder, we're using jest
as a test running and `react-test-renderer` as a testing library, some tests are still using
`enzyme`, but this lib is not maintained anymore and doesn't support newer versions of React,
so those should eventually be migrated.

To run unit tests on all packages, run the following command:

```
Expand All @@ -92,6 +100,14 @@ make pkg-test-bar

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

#### End-to-end tests

Sometimes it's difficult to test certain things in unit tests, from our experience, animations
and interactions can be tricky to test via unit tests only, so we also try to have end-to-end tests.

We're using `cypress` for writing such tests, and those are located in the `cypress/src/components`
folder, as we introduced end-to-end tests later, not all packages have some.

### Formatting

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

0 comments on commit 073fa85

Please sign in to comment.