Skip to content

Commit ec4e8f0

Browse files
authored
document test:coverage (#1820)
1 parent a24e805 commit ec4e8f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Please run Prettier before submitting any pull request. Check “format on save
4242
yarn prettier --write .
4343
```
4444

45+
A test coverage report can be generated with [c8](https://github.com/bcoe/c8), in text and lcov formats, to help you identify which lines of code are not (yet!) covered by tests. Just run:
46+
47+
```bash
48+
yarn test:coverage
49+
```
50+
4551
### Unit tests
4652

4753
Unit tests live in `test` and have the `-test.js` file extension; see [`test/marks/area-test.js`](./test/marks/area-test.js) for example. Generally speaking, unit tests make specific, low-level assertions about the behavior of Plot’s API, including internals and helper methods. If you add a new feature, or change the behavior of an existing feature, please update the unit tests so that we can more easily maintain your contribution into the future. For example, here’s a unit test that tests how Plot formats months:

0 commit comments

Comments
 (0)