March 2023
Intermediate to advanced
280 pages
3h 52m
English
A test double is a special type of function (or object) that replaces a dependency of the structure under test with a “blank” version, which avoids doing any of the real work of the dependency.
In this chapter we’ll look at the common scenario of using test doubles to replace the global.fetch function that makes HTTP requests.
The different types of test double
How to implement a spy function and its matcher
By the end of the chapter, you’ll be confident with the use of test doubles.
Usually these ...
Read now
Unlock full access