-
Notifications
You must be signed in to change notification settings - Fork 44
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
css-modules-require-hook
and jest
#109
Comments
There is a good solution for jest in official docs: http://facebook.github.io/jest/docs/en/webpack.html#mocking-css-modules It replaces all the css files with Proxy object, so you'll be able to access all the keys without any computations. {
"jest": {
"moduleNameMapper": {
"\\.scss$": "identity-obj-proxy"
}
}
} |
This is only a solution in that it allows tests not to fail. Using this actually changes the behaviour of a React component where I have been trying to find a solution to this that actually imports the CSS via CSS Modules. I have a documentation generation script that uses |
Hi, I've been using |
Hi there, any progress with that? |
#I have this setup in my
jest
config.When I use
mocha
this resolves to_styles_header__styles
which is something I can test against.However, in
jest
this returnsundefined
.The text was updated successfully, but these errors were encountered: