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

First, thanks for the great work here. Just a question - are es6 modules supported (given that its cache is not exposed via hooks yet)? I need this info to...

There has been some intermittent discussion of how we can make the tdjs API feel terser for async functions, and support is good enough now that I think we can...

enhancement

### Description I attempted to use `td.replace(object, 'property')` to replace a property that is defined as a getter using `Object.defineProperty` and got an error. ### Issue Attempting to set a...

### Description let's say that we have an interface like this in typescript ```typescript interface Test { getT: () => {id: number} } ``` now we can mock it like...

# Issue `td.verify` throws weird error msg when call param has an Invalid Date inside it. ### Environment Node.js v12.13.1 [email protected] ### Example Repo #### Runkit Notebook https://runkit.com/alexbepple/5eb3db7fda92cd001a8c3b9f #### Code-fenced...

We just ran into a strange issue where our tests accidentally replaced the same function twice where the second replace then replaced the testdouble function with yet another one. The...

enhancement

### Description We are trying to stub a function that accepts as an argument a very large/deep object. The specific function is `graphql(schema, …)` where the first argument is a...

### Description Per the [documentation](https://github.com/testdouble/testdouble.js/blob/7b222aeef090678eb3a6054675c69a1391387b7b/docs/5-stubbing-results.md#arrays) and the [tests](https://github.com/testdouble/testdouble.js/blob/ca452500f036e03b1e00c56f1983fec4bcaab78c/test/safe/matchers.test.js#L116) the `td.matchers.contains()` can take multiple arguments. However, the [type definitions](https://github.com/testdouble/testdouble.js/blob/7b222aeef090678eb3a6054675c69a1391387b7b/index.d.ts#L38) do not account for this. ### Issue If you attempt to compile...

## Problem In promise-y code, a return value of `undefined` (testdouble's default return value) is nonsensical and will break things. As a result, people faking out promise APIs, will very...

Hello. I'm trying to follow the game of life discovery testing by Justin Searls , with TypeScript. I added the second test, without changing the code, and it passes: ```javascript...