-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
How test with Jest? #54
Comments
I have same issue. You solved it? |
Unfortunately no @chacbumbum |
Bump. Stuck with the same issue |
Thanks @darkowic I needed just a solution to mock all the |
Facing the same issue but with |
Anyone had any luck with this? @darkowic I do not completely understand your approach, can you please elaborate? |
The workaround simply imports string instead of the real module |
This notation ``` require('imports-loader?define=>false,this=>window!datatables.net')(window, $) ``` break jest test webpack-contrib/imports-loader#54 and they suggest to use loaders in webpack config jestjs/jest#4868 but that will complicate installation in rails since we need to configure webpacker to disable amd only for datatables.net dependency
Here a lot of examples - https://jestjs.io/docs/en/webpack, if somebody still have problems, please open an issue in jest |
I'm trying to setup Jest tests configuration for my project. I use imports-loader to load some old jQuery libs
When running tests with jest I get following error:
As a workaround, I mock all imports-loader in Jest config
How to configure it to actually import correct module?
The text was updated successfully, but these errors were encountered: