-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[system] Need for consistent CSS classes in snapshot tests #40448
Comments
Seems like an issue with the difference in your environments? Could you have the same env vars in your local tests that are on your CI ? |
Yes, there indeed is a difference for the |
I don't see how a runtime variable can be introduced here unless you actually call |
We prefer to keep using 'production' as node_env. Thanks for the help anyways! 🙏 |
@mennorenkens @brijeshb42 So, what's remaining to do here? |
Duplicates
Summary
We have some snapshot tests in our test-suite. They simply compare HTML states between test runs, and fail if anything changed.
These do not work well with MUI unfortunately. When we generate the initial snapshots locally (or update them), the generated CSS class names in the HTML files are different from the ones that our testing-server generates and compares to.
This is due to the fact that our local environments have a different
NODE_ENV
than our CI server.We found that the logic is in
node_modules/@mui/system/modern/createStyled.js
:Is it possible to determine this based on a runtime variable instead of a compile time one, like
NODE_ENV
? If not, do you have other suggestions?Examples
No response
Motivation
No response
Search keywords:
The text was updated successfully, but these errors were encountered: