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