Mocks, Fakes, and Coverage
Isolate units and measure what you test.
Isolate the Unit
A unit test should check one piece in isolation. Real databases or networks make tests slow and flaky, so we replace them. 🔌
Test Doubles
A test double stands in for a real dependency. Mocks, fakes, and stubs are the common flavors you reach for.
All lessons in this course
- Your First test and expect
- group, setUp, and tearDown
- Testing async Code and Streams
- Mocks, Fakes, and Coverage