I'm using jest-styled-components: 4.10.0 and when I run jest. I get the below.
FAIL src/components/Button/tests/index.test.js
โ Test suite failed to run
Cannot find module 'styled-components/lib/models/StyleSheet' from 'utils.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:194:17)
at Object.<anonymous> (../../node_modules/jest-styled-components/src/utils.js:3:20)
index.test.js does only a plain import as below.
import 'jest-styled-components';
We're using a mono-repo setup with yarn workspaces btw.
Can you help us identify the issue? Please let me know if you need anything further to debug the issue. Thanks!
Most helpful comment
https://github.com/styled-components/jest-styled-components/issues/112