From the course: Testing React Applications with Jest and React Testing Library
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Setting up Vitest for code coverage reports
From the course: Testing React Applications with Jest and React Testing Library
Setting up Vitest for code coverage reports
- [Instructor] Writing tests that pass is one thing, but how do you know if those tests are truly meaningful? Are they covering the parts of your code that matter most? It's easy to assume everything is working just because your test script turn screen. But what if there are critical sections of your code that no test ever touches? Silent (indistinct) could be hiding in those untested parts. That's why it's important to understand how much of your code is actually being tested. Measuring coverage helps you identify the gaps, so you're not just writing tests, but writing the right tests. In order to achieve these, we need to set up code coverage reports using Vitest. Code coverage is a critical part of testing, because it helps us understand how much of our code base is being tested and identify areas that need more attention. I know you'll be wondering why setting a code coverage report really matters. Well, it shows which parts of your code aren't covered by test, helping you catch…
Contents
-
-
-
-
Introduction to Vitest and React Testing Library2m 4s
-
(Locked)
How to configure Vitest and RTL4m 22s
-
(Locked)
Writing simple unit tests3m 39s
-
(Locked)
Setting up Vitest for code coverage reports5m 16s
-
(Locked)
Challenge: Simple unit and integration tests2m 56s
-
(Locked)
Solution: Simple unit and integration tests3m 21s
-
-
-
-
-