1. 12
    Mock Modules in a React Component Test
    5m 40s

Mock Modules in a React Component Test

InstructorAndy Van Slaars

Share this video with your friends

Send Tweet

Our unit tests should never rely on code that is outside our control and they certainly shouldn't be calling across the network to a server. A good test needs to be repeatable and fast and relying on outside systems and/or data doesn't help us meet those goals. In this lesson, we'll use mocks to create an environment where we control the response for service calls. This will allow us to be confident in our assertions and ensure our tests aren't flaky.