lundi 15 juin 2020

Why is my jest test coverage lower if I run the test on a single file?

I am adding test coverage to a large file. When I run the coverage report for all my tests, the coverage is at 80.00%. But in order to add more coverage I run the single file in isolation in watch mode to see the coverage change every time I add more tests.

When I do this the coverage instead of being 80.00% drops to 65%.

Does this mean that there are other test files using methods that add coverage?

Does this mean that if myFile.js has a fetchOrders function, but myfile.test.js does NOT test this function, jest will consider that function to be covered if another file named myOtherFiile.js happens to trigger fetchOrders in its myOtherFile.test.js file?

Aucun commentaire:

Enregistrer un commentaire