This repo demonstrates how a HTML test can affect the overall code coverage result.
# Install dependencies
$ npm i
Steps to reproduce the issue is as follows:
- First, run
npm t
to see the test runner reports 100% code coverage. - Then, uncomment L29 in
web-test-runner.config.mjs
and runnpm t
. - Now, you will see the code coverage drops below 100% even though all LOCs are covered and tested in all tests.
Code coverage with JS tests only
All codes are covered in JS tests and it shows 100% code coverage.
Code coverage with JS and HTML tests
All codes are covered in JS tests but not in HTML test. This causes the code coverage to drop below 100% even though all lines of code are covered in JS tests.