Skip to content

motss/wtr-code-coverage-issue

Repository files navigation

code coverage issue in wtr

This repo demonstrates how a HTML test can affect the overall code coverage result.

Setup

# Install dependencies
$ npm i

How to reproduce the issue

Steps to reproduce the issue is as follows:

  1. First, run npm t to see the test runner reports 100% code coverage.
  2. Then, uncomment L29 in web-test-runner.config.mjs and run npm t.
  3. Now, you will see the code coverage drops below 100% even though all LOCs are covered and tested in all tests.

Output

Code coverage with JS tests only

All codes are covered in JS tests and it shows 100% code coverage.

code coverage with js tests only

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.

code coverage wih js and html tests

About

Simple repo to reproduce code coverage issue in wtr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published