Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'react' from 'node_modules/react-redux-test-utils/dist/unit-test-helpers.js' #4

Open
moezbenrebah opened this issue Mar 9, 2023 · 0 comments

Comments

@moezbenrebah
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant