Open jehy opened 4 years ago
This is a quick and a bit dirty solution for https://github.com/rogeliog/jest-runner-mocha/issues/24
It does not break anything but lets you use setupFilesAfterEnv and use clearMocks if it is enabled and exported from one of the setup files.
setupFilesAfterEnv
clearMocks
For example, we use sinon but we can enjoy independent mocks with a simple clearMocks implementation:
const sinon = require('sinon'); module.exports = { clearMocks: () => { sinon.sandbox.restore(); } };
I'm not sure if it will play as well with clearing jests's native mocks - but right now clearing native mocks does't work anyway.
This is a quick and a bit dirty solution for https://github.com/rogeliog/jest-runner-mocha/issues/24
It does not break anything but lets you use
setupFilesAfterEnv
and useclearMocks
if it is enabled and exported from one of the setup files.For example, we use sinon but we can enjoy independent mocks with a simple clearMocks implementation:
I'm not sure if it will play as well with clearing jests's native mocks - but right now clearing native mocks does't work anyway.