-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
fix(jest): Sass require in html #1068
Conversation
Fix error when testing a component that has a require tag with a sass file. Closes aurelia#67
There is the other generic jest recommended way. https://jestjs.io/docs/en/webpack#handling-static-assets If don't want to write the mock module, can use https://github.com/eddyerburgh/jest-transform-stub |
@huochunpeng Thank you for the info, I will try that proxy setup. If it resolves this issue I will change this PR. |
@huochunpeng I've looked at the documentation and this setup only works for static content loaded via import statements in your js/ts files. The issue reported describes a flow where a sass file is loaded using a |
:-) Removing Even with |
Thank you for the example, I will give it another try. I think I missed the transform entry in the config :/ |
@huochunpeng I can confirm installing jest-transform-stub and adding it as a custom transform entry there is no need for the change in this PR. Do you think we should/could provide this solution out of the box in aurelia cli? |
Absolutely. Let’s get it in after the big refactoring PR. |
@huochunpeng ok I will close this PR and create a new one after the big refactor PR is done. Where can I track the status of the PR you are referring to? |
Some additional info on stubbing, for me it still fails when adding jest-tranform-stub to the moduleNameMapper. Only adding it to transform seems to work fine (haven't testing imports from TS yet) |
Fix error when testing a component that has a require tag with a
sass file.
Closes aurelia/testing#67