-
Notifications
You must be signed in to change notification settings - Fork 149
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
configureStore is not a function via module.exports #159
Comments
The const { configureStore } = require('redux-mock-store'); |
Can you create a repository that recreates a basic example of this error? |
Link: https://github.com/Kronenberg/redux-thunk-tests-example |
Did you try const configureStore = require('redux-mock-store').configureStore ? or const redux_mock_store = require("redux-mock-store")
const configureStore = redux_mock_store.configureStore Let me knwo ig that worked |
@Kronenberg Sorry for late response. It looks like you have a typo in your code. // 👇 this works for you
import configureMockStore from "redux-mock-store";
// 👇 notice how you named this import "configureStore", rather than "configureMockStore"
const configureStore = require('redux-mock-store').default(); I changed the below and it worked. - const configureStore = require('redux-mock-store').default();
+ const configureMockStore = require('redux-mock-store').default; I changed the import name from |
This should be fixed in my TypeScript fork: #148 (comment) |
still not working, im using version 1.5.3 whenever i use it as:
i get |
Try |
same problem, at this point i think it has something to do with jest and the way i have it configured, do you think i should add this lib to the trransformIgnorePatterns? if i open node and import it manually it works flawlesly but not with jest :( |
I have it working with Jest here, FWIW. |
same issue, its not working for me, at this point it could really be my setup because no matter how i change the redux-mock-store library, it keep getting the same error |
Please leave your jest config file in more detail. |
Here is my example
I am try to require and run this module but have error: TypeError: configureStore is not a function
With regular import configureStore from 'redux-mock-store' everything works fine.
But i can't use imports in any case. Can somebody help me with that?
The text was updated successfully, but these errors were encountered: