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
Automatically mock require.context when VUE_CLI_BABEL_TRANSPILE_MODULES is true #193
Comments
As far as I understand, the problem is that Jest is not able to use dynamic imports (this is a feature of webpack) |
As @EgorFront mentioned, there are a number of solutions. My preferred solution has usually been to isolate the |
Adding a https://www.npmjs.com/package/babel-plugin-transform-require-context Just add into
|
Is this all you did? Because I can't get this to work. Also, I'm new to Jest and not sure how to mock this if that is what I have to do. tHanks. |
Hey @beamsies - See this answer: https://stackoverflow.com/a/61137440/7358308, also you can look at other answers and try it out |
I used this package to fix this problem: https://www.npmjs.com/package/require-context.macro |
Sorry for the delay in responding to this. I let the project lapse and am in the process of currently updating it to Vue 3 standards. In order to clean up issues, I'll be closing this issue at this time, but if you still have issues with the new boilerplate or have questions, please don't hesitate to open another issue. |
I used
yarn new module
command to create a new vuex module to test my app. However, I stumbled in the following error:This error occurs on every vuex module file.
Bellow, this is an example of a vuex module:
And this is its test:
This error doesn't occurs on newly created module using
yarn new modules
so I'm probably doing something wrong. If anybody have any clues in this matter, I would be very gratefulThe text was updated successfully, but these errors were encountered: