-
Notifications
You must be signed in to change notification settings - Fork 27
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
Tests fail when Code splitting components #24
Comments
same problem here; |
@LanFeusT23 did you come up with a solution for this? |
Nope, we decided not to code split down to components. We code split on routes only so we don't have this issue. It was ok with us because our modals were really small and code splitting was not gaining much. |
@LanFeusT23 here is what you need to do: yarn add --dev babel-plugin-dynamic-import-node Then in the "presets" [
// ...
],
// add env specific configuration
"env": {
"test": {
"plugins": [
"transform-runtime",
"dynamic-import-node" // <-- this is the important line
]
}
} |
This is still a problem for me. The solution posted by @rudionrails does not work. |
I'm submitting a ... (check one with "x")
Current behavior
Testing vue components with code splitting is throwing on the import
Minimal reproduction of the problem with instructions
Create a component that async loads other components:
Create a tests, upon running jest it throws an exception on the import
The text was updated successfully, but these errors were encountered: