Hello all, I recently began to test redux reducers, and I found the 'react-redux-test-utils' package, but I have an error occurred:
Cannot find module 'react' from 'node_modules/react-redux-test-utils/dist/unit-test-helpers.js'
Require stack:
node_modules/react-redux-test-utils/dist/unit-test-helpers.js
node_modules/react-redux-test-utils/dist/index.js
task_1-test_1.test.js
my test code:
import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';
import { DISPLAY_NOTIFICATION_DRAWER, LOGIN_SUCCESS } from './uiActionTypes';
import { uiReducer } from './uiReducers';
const fixtures = {
'it should update the notifications visibility': {
action: {
type: DISPLAY_NOTIFICATION_DRAWER,
}
},
};
describe('LoginForm - Reducer', () =>
testReducerSnapshotWithFixtures(uiReducer, fixtures));
I tried to find a solution but I didn't figured out how