testdouble.js icon indicating copy to clipboard operation
testdouble.js copied to clipboard

A minimal test double library for TDD with JavaScript

Results 59 testdouble.js issues
Sort by recently updated
recently updated
newest added

Terrible luck to discover this after releasing 2.0.0, but subsequent improvements to the build have made me realize that the cute way we do this: ```js module.exports = { function:...

Proposal: allow test double stubbing/verification configuration to specify the value of `this` that's bound when the test double function is called. ```js td.when(myTd(), {withContext: window})).thenReturn(5) myTd() // undefined myTd.bind(window)() //...

I'm currently working with testdouble.js with a callback-based API, and if I _miss_ a stubbing, I only know that when the test times out (or when I see it hang)....

If I do a test double func: ``` var dog = { bite: function (thing) {} } var woof = td.replace(dog, 'bite') ``` Then setting up a stubbing with a...

Proposal: a new top-level method designed to be run in an `afterEach` block of the user's tests, and passed a boolean as to whether or not the test failed. When...

Regarding this doc: https://github.com/testdouble/testdouble.js/blob/master/docs/3-getting-started.md#creating-a-test-double We received these four chat messages as in-the-moment feedback: > this example is abit funky > …as the example, and MathProblem, doesn’t take constructor arg, but...

### Description I'm working on a Next.js app that uses testdouble.js for mocking dependencies in tests. Our test environment uses **Jest** and runs under **Babel**. This issue revealed itself when...

### Description I'm trying to use testdouble in a Typescript project using ESM modules, and I get a `TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts` error when I try to use...

It would be great if `td.reset()` optionally accepted a list of modules to reset, like: ```js td.reset(); // nuclear option → reset everything td.reset('module-a.js'); td.reset( 'module-a.js', 'module-b.js', ); ``` The...

Changelog.md most recent is 3.18.0