codelegant codelegant - 1 year ago 128
React JSX Question

jest --coverage show the wrong path

enter image description here

Like the pic above, I move the dir

and file
, then run
npm test -- --coverage
in Terminal.

The test is passed, but the path in coverage is wrong. It seems the jest had cache the old path.

What's wrong with the jest? Waiting online, thanks very much.


Answer Source

I checked your project and I think you're right. Look at execution times, it's only ~0,5s for one test. Try

npm test -- --coverage --no-cache 

to run your test without cache. Now test execution should take ~23s and path should be updated.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download