Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
40.11k
stars
2.48k
forks
source link
Jest test fail on upgrading the styled-components lib version from 5.3.1 to 6.1.8 #4273
Open
priyapwr7 opened 2 months ago
Hi All,
When I updated the styled-components library version from 5.3.1 to 6.1.8 , the jest test fail with error as mentioned below:
TypeError: p.compile is not a function
I have used the lib here:
import styled from 'styled-components';
export const CustomDatePicker = styled(Button)` && { margin-left: 1%; }
the jestconfig file has below properties set:
testPathIgnorePatterns: ['/node_modules/'],
transformIgnorePatterns: ['/node_modules/(?!(@ui5|lit-html|d3|internmap)).*\.js$'],
moduleNameMapper: {
'\.(css|less)$': 'identity-obj-proxy',
'axios': "axios/dist/node/axios.cjs",
},
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
setupFilesAfterEnv: ['core-js', '/jestSetup.js'],
moduleDirectories: ['/node_modules', '/src'],
The app runs fine but jest tests fail Please let me know how to solve this issue.