Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k
stars
785
forks
source link
my ajax function somehow not covered by istanbul #892
somehow this unit test is working as I expected but code coverage says the statement is not covered
this says the statement is not covered
as i understand my code works fine and unit test is working as expected why jest code coverage says this statement not covered can anyone explain how this statement covered works ? and why mine is not covered, i believe this is my fault but i don't know what to investigate here
--- update ---
this my silly mistake, it only needs to mock the post and chaining on function like this
I have a question I have this function
so i want to code coverage this function and i make some unit test using Jest here's the unit test code
somehow this unit test is working as I expected but code coverage says the statement is not covered
this says the statement is not covered![screenshot_14](https://user-images.githubusercontent.com/10882685/42201235-1d9a6b3a-7ec1-11e8-9ebb-d0c8bc2ddc3e.png)
as i understand my code works fine and unit test is working as expected why jest code coverage says this statement not covered can anyone explain how this statement covered works ? and why mine is not covered, i believe this is my fault but i don't know what to investigate here
--- update ---
this my silly mistake, it only needs to mock the post and chaining on function like this