From the course: Node.js: Testing and Code Quality
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Isolate routes for faster tests
From the course: Node.js: Testing and Code Quality
Challenge: Isolate routes for faster tests
(upbeat music) - [Instructor] In this chapter, we saw that functional testing can be slower than just unit testing due to the complexity of setting up and tearing down the application. How can we minimize that overhead and speed up testing? Your challenge is to restructure both the application and tests so an individual router can be tested using the base-application configuration. I'll give you a hint. Is it easier to mock one file or mock all files except one? When you're done, check out one possible solution in the next video. See you in a moment.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Why code coverage matters5m 22s
-
(Locked)
Measuring code coverage with Jest5m 54s
-
(Locked)
Functional testing with Jest4m 1s
-
(Locked)
Test doubles and Express apps5m 53s
-
(Locked)
Form submissions with SuperTest6m 9s
-
(Locked)
Fallacies of 100% test coverage4m 19s
-
(Locked)
Coverage with continuous integration4m 34s
-
(Locked)
Challenge: Isolate routes for faster tests39s
-
(Locked)
Solution: Isolate routes for faster tests9m 27s
-
(Locked)
-