Skip to content

Glossary: JavaScript Beyond the Basics

Test double

Also written: stub, fake

A stand-in that replaces a risky part, such as the email sender or the clock, during a test. Mock functions and fake timers are examples.

Where the book teaches it

Related terms

Mock functionFake timersDependency injection