Remap Istanbul incorrect coverage report

296 Views Asked by At

Running a react redux app with typescript i get incorrect coverage results when running karma webpack with istanbul-remap for mapping back to typescript source code.

For example i added a change to a react unit test that makes the code not go into the mapStateToProps and mapDispatchToProps anymore (ignoring the redux flow). without using remap i get correct coverage decrease like so:

correct coverage decrease

with remap i get incorrect coverage result:

incorrect coverage result

1

There are 1 best solutions below

0
On

After changing the webpack typescript loaders from

loaders: ['react-hot', 'ts-loader']

to:

 loader: 'ts-loader'

in the webpack test config file i got coverage

fixed coverage result