dillon1000/react

Commit

Store dirtyMocks array globally so it can survive dumpCache().

When require("mock-modules").dumpCache() is called, all mock functions
previously created continue to refer to the old dirtyMocks array.

If we replace that array with a new one, those mock functions will never
have their .mockClear() methods called again.

The upstream version of mocks.js pulls a similar global trick, and I never
understood why until now.
Browse files
Changed paths1 file
First-parent comparison
M src/test/mocks.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…