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.
How Are Test Doubles Useful?
Usually these ...