rehansaeed.github.io
rehansaeed.github.io copied to clipboard
[Comment] Code Coverage & Frontend Testing
https://rehansaeed.com/code-coverage-and-frontend-testing/
Good article.
I just wanted to point out something for anyone reading who might have added coverage reporting to their jest tests and been surprised by a relatively high coverage amount:
By default jest only checks the coverage of files that are imported (directly or indirectly) by the files under test.
To check coverage of all your source files you must tell jest which paths to collect coverage from using collectCoverageFrom.
@codeandcats Good top tip!