Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Start a free Basic trial
to watch this video
In this video we'll look at what a coverage report looks like and what it all means.
-
0:00
Open the coverage folder and then the lcov report folder.
-
0:06
This is the folder where your HTML code coverage report is generated.
-
0:11
Open up the index.html in the web browser.
-
0:15
We can see the project folder name here.
-
0:18
A progress bar reporting how much the code is covered and some other metrics.
-
0:25
We see that eight out of nine statements have been tested.
-
0:30
In other words, 88.89% of the code is covered.
-
0:36
100% of the conditions have been covered.
-
0:39
Well, actually, there's no conditional statements in the code.
-
0:44
So is 0 out of zero 100%?
-
0:47
I guess it is.
-
0:48
Then, we have 75% of the functions in the code covered.
-
0:52
Not bad.
-
0:53
That's why it's highlighted in yellow.
-
0:55
Finally, the lions.
-
0:57
Eight out of nine lines are covered in the code.
-
0:59
Let's dig into the report a little deeper.
-
1:02
Since our project is only one file, there are no other directories and
-
1:07
there's only one file listed, the index.js file.
-
1:10
And it has all the same metrics as the project.
-
1:15
Let's click into the index.js file.
-
1:19
The red lines on this page are the lines not covered by tests
-
1:23
In this case the multiply function.
-
1:26
In the next video, we'll improve code coverage and
-
1:29
highlight another important detail in this report.
You need to sign up for Treehouse in order to download course files.
Sign up