Reputation: 2096
I have a unit-test run with Jasmine. When i run this unit-test it not have any error, but when i view it in code coverage. It show some error with message: "Statement not covered"
I want to solve this error. What can i do? Thanks
Upvotes: 4
Views: 14496
Reputation: 162
Ask yourself if this is an actual error. ;)
Your unit-test run and as you said, the unit test runs without error. Good for you! Code coverage however shows you that the indicated lines are not tested. This is not an 'error'. Your job is to write more test, to explicitly test these lines.
Upvotes: 5
Reputation: 32964
if you want to solve this then you should have additional unit tests which tests the cases when paymentData.accessionInfo
and paymentData.prepaymentInfo
are set to truthy values.
It seems that currently your tests do not contain the correct data to enable those code paths to be executed
Upvotes: 1