How do I read an Istanbul Coverage Report?

前端 未结 3 1194
野性不改
野性不改 2021-01-29 17:19

I\'ve always used Jasmine for my unit tests, but recently I started using Istanbul to give me code coverage reports. I mean I get the gist of what they are trying to te

3条回答
  •  悲哀的现实
    2021-01-29 18:00

    Adding to the previous answers

    The %Statements is calculated by taking a percentage of the number of statements covered by your test e.g 12/18 * 100 = 66.67%. This means that your test covered only 66.67%.

    The %Branch is also calculated in the same way. Same for your %Functions and %lines.

    In your project root directory, there is a coverage folder that contains HTML output of your test. Click on it and view it in the browser. You should see something like this

    Image showing the output of your test results

    I hope this helps you understand it better.

提交回复
热议问题