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

Configuring store for all React tests #165

Open
maksimgm opened this issue May 9, 2019 · 1 comment
Open

Configuring store for all React tests #165

maksimgm opened this issue May 9, 2019 · 1 comment

Comments

@maksimgm
Copy link

maksimgm commented May 9, 2019

I want to know if there is a way to configure jest and enzyme tests to contain a react store? I'm aware that there is a way to configure a store for an individual react component when it is connected with redux. I have a helper method which returns an array of react components which are untested. So instead of testing all 20 react components, I think configuring a mock store should solve it. This is my error:

FAIL  src/core/factory/__tests__/searchFactory.test.js
  ● Test suite failed to run

    TypeError: Cannot read property 'reducers' of undefined

      26 | const oidcMiddleware = createOidcMiddleware(mgr, true, false, API_LOGIN_CALLBACK, null);
      27 | 
    > 28 | const store = init({
         |               ^
      29 |   models,
      30 |   plugins: [selectorsPlugin()],
      31 |   redux: {
@newyork-anthonyng
Copy link
Contributor

@maksimgm Can you create a minimal project that reproduces this?

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

2 participants