Hi guys, recently I've been trying to upgrade styled-components to 5.2.0 and jest-styled-components to 7.0.3.
During my trials, I've found that when I pass theme values using ThemeProvider context, I get No style rules found on passed Component error and tests are failing. But, when I pass them as an inline prop tests are passing.
@enginaryum I had the same issue. Solved by adding this in jest.config.js"moduleNameMapper": { "styled-components": "<rootDir>/node_modules/styled-components/native/dist/styled-components.native.cjs.js" } }
Hi guys, recently I've been trying to upgrade styled-components to
5.2.0
and jest-styled-components to7.0.3
.During my trials, I've found that when I pass theme values using ThemeProvider context, I get
No style rules found on passed Component
error and tests are failing. But, when I pass them as an inline prop tests are passing.Is there something I'm missing here?
package.json
test snippet
test results