Code I'm working with:
// redux-reducer.js
import { combineReducers, loop, Effects } from 'redux-loop'
import { loginStart } from './actions'
import {
signUp,
login,
refreshAccessTokenStart,
replayAction,
postConfirmationToken,
postRequestForPasswordReset,
postNewPassword
} from './effects'
...
...
...
// redux-reducer-test.js
import combinedReducer from './reducers'
beforeEach(() => {
require.requireMock('effects') // something like this
})
...
...
...
The problem is that the local ./effects
module calls react native environment config scripts.
I thought to mock the ./effects
module in such a way that ./effects
doesn't get executed.
Things that haven't yet worked:
- using the
require.requireMock('effects')
method - letting it be mocked automagically
- using proxyquire: I thought
proxyquire.noCallThru()
would prevent./effects
being run. Seems proxyquire isn't compatible with Jest, and that there should(?) somehow be this functionality within Jest?
Interested to hear your thoughts and learn more about Jest!