testdouble.js (AKA td.js)

Welcome! Are you writing JavaScript tests and in the market for a mocking
library to fake out real things for you? testdouble.js is an opinionated,
carefully-designed test double library maintained by, oddly enough, a software
agency that's also named Test Double. (The term "test
double" was coined by Gerard Meszaros in his book xUnit Test
Patterns.)
If you practice test-driven development, testdouble.js was designed to promote
terse, clear, and easy-to-understand tests. There's an awful lot to cover, so
please take some time and enjoy our documentation, which is designed to show you
how to make the most out of test doubles in your tests.
This library was designed to work for both Node.js and browser interpeters. It's
also test-framework agnostic, so you can plop it into a codebase using Jasmine,
Mocha, Tape, Jest, or our own
teenytest.
Install
$ npm install -D testdouble
If you just want to fetch the browser distribution, you can also curl it from
unpkg.