-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
@media doesn't seem to compile with css / scss modules + more #235
Comments
@dannyvassallo Thank you for your kind words and your report on this issue. TBH, I am kind of busy for a couple of weeks ahead, I will try to look into your issue in more detail, maybe at the beginning of September. In the meantime, can do me a favor by creating a reproduction using one of those? It would help me to support you better.
If it's a different issue, can you please do me a favor by creating another issue with a minimal reproduction? Thanks.
It's super great. Thank you for offering your help. I can absolutely guide you, but please give me a couple of weeks. For now, I can suggest you some useful resources to get more familiar with Jest Preview
I hope |
Can you provide minimum reproduction. I added a commit to include
Please help to prepare a reproduction. In our demo, we can jest-preview/demo/setupTests.js Line 4 in 41019e6
|
It looks like you are correct! I do think I might have an idea of what's happening. I think the class name property on the component changes based on the media or screen size and it doesnt seem to be updating properly. Regardless of the window or screen size I stub in jest, it falls back to either default or the mobile values. Maybe it's something with the way I'm handling my renders? |
The Problem
I'm using jest-preview to visualize screens using css modules. Some of the styling is dependent on media queries. None of the
@media
statements seem to get compiled into the embedded style tags. Other classes from the module make it in fine.I also cannot import SCSS files into the setup file. If I compile them using gulp or webpack and then import the resulting
.css
file, it appears to work fine.Additional issue but not related, I can't get auto preview to work at all.
What I've tried
So far I've tried compiling the SCSS myself and removing hashes from the class names. I've faced trouble using the advanced configuration to try and remove the hashes from the jest-preview transform source. This didn't seem to work either.
I've also tried using a custom transform with some additional postCss utilities but haven't had any success. If I render components with no media queries, this tool is absolutely wonderful.
What is the framework/ technology you want to integrate Jest Preview to?
Thank you
Thank you for your time and continued effort on this tool! If I can contribute, I'd love to if someone can point me in the right direction.
The text was updated successfully, but these errors were encountered: