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
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -944,15 +944,14 @@ However, we prioritize user-centric testing over coverage numbers.
944
944
-**Coverage Threshold:** We aim for a test coverage of 95% for the unit tests. This threshold is set in the `.nycrc.json` file.
945
945
-**Coverage Reports:** We use [nyc](https://www.npmjs.com/package/nyc) to generate coverage reports, which are available
946
946
in the `coverage` folder after running the tests. These reports are also published to [Coveralls](https://coveralls.io/github/IQSS/dataverse-frontend?branch=develop)
947
-
with every pull request and merge. The coverage badge is displayed at the top of the README.
947
+
with every pull request and merge. The coverage badge is displayed at the top of the README. See "include" and "exclude" in `.nycrc.json` to learn about which source files are included in coverage reports.
948
948
-**Tests included in the coverage:** We include all unit tests in the coverage report.
949
949
950
950
#### How to run the code coverage
951
951
952
-
To generate the code coverage, you first need to run the tests with the `test:unit` script. After running the tests, you
953
-
can check the coverage with the `test:coverage` script.
952
+
To generate the code coverage, you first need to run the tests with the `test:unit` script. This can take a while! After running the tests, you can check the coverage with the `test:coverage` script. This will simply report the total coverage.
954
953
955
-
If you want to see the coverage report in the browser, you can open the `coverage/lcov-report/index.html` file in the browser.
954
+
To see which lines are not covered, you can open the coverage report in the browser: `coverage/lcov-report/index.html`.
956
955
957
956
```bash
958
957
# root project directory
@@ -964,8 +963,12 @@ npm run test:unit
964
963
# Check the coverage
965
964
966
965
npm run test:coverage
966
+
967
+
# See detailed report at coverage/lcov-report/index.html
967
968
```
968
969
970
+
Note that it's easy for the `lcov-report` report to get overwritten. For example, running any test with `npm run cy:open-unit` will overwrite it. For this reason you might want to copy the `lcov-report` directory elsewhere for safe keeping. That’s mainly useful for debugging previous coverage results and improving them.
971
+
969
972
<p align="right">(<a href="#readme-top">back to top</a>)</p>
0 commit comments