Jest-styled-components: Cannot find module 'styled-components/lib/models/StyleSheet' from 'utils.js'

Created on 23 Jan 2018  ยท  1Comment  ยท  Source: styled-components/jest-styled-components

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

>All comments

Was this page helpful?
0 / 5 - 0 ratings