Closed PBug90 closed 3 years ago
You should be able to remove the "then" prop for a test using
JestMockExtended.configure({
ignoreProps: [],
})
in your afterEach() you can do
JestMockExtended.resetConfig();
You need version 2.0.1
to do this
This breaks older APIs that might chain a .then() call, like the following example using jsforce:
Minimum test setup example:
Batch source code with .then defined on Batch prototype: https://jsforce.github.io/jsforce/doc/api_bulk.js.html#line486
The reason is the following line: https://github.com/marchaos/jest-mock-extended/blob/d08e7811dafe7b42da8513a6ed284a3d80f63998/src/Mock.ts#L91