experimentation with code coverage through jest #373
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
I enabled code coverage reports via jest to see how it works and what our current coverage levels are. I did not enable a failure threshold, but jest allows us to configure different thresholds for the entire app vs functions vs groups of lines, which we could use with our CI to auto-fail anything not passing those thresholds without adding any additional steps to the CI itself. See https://jestjs.io/docs/configuration#coveragethreshold-object
These are the types of results I am currently getting with the default reporter:
[alt: code coverage report with low 60% for all files, decent coverage for the api directory, and then very little to no test coverage for the apps/orgs directory. A list of uncovered line numbers accompanies the results.]
I have the following questions:
Run code coverage
Just run
npm run test
like normal (you will need the docker db and uaa running) and at the end you will get a report in your console.Related issues
part of #126 (not completed because we're lacking thresholds and also we need to beef up tests to meet thresholds, likely)
Submitter checklist
Security considerations
None that I am aware of