Can't use styled-engine-sc with jest and npm

Open
#30,957 9 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

package: styled-engine-sc scope: system
Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Current behavior 😯

Hello.

I just migrated to material ui v5.
I'm using it with styled components.

Everything is OK when I start my app with craco and webpack with the alias config.

Now, i'm trying to launch my jest tests, but I have the engine problem (Module not found: Can't resolve '@emotion/react' )
npm run test
scripts:{ "test": "craco test }

As jest is not launched with webpack, the styled engine configuration is not applied.

What is the solution to use jest, mui with styled components, and npm ?

Thanks

Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mui/material-ui

All issues in mui/material-ui

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.