I don't know if this package should try to handle this or not, but here goes. If I write a style that uses the nullish coalescing operator, Jest complains:
undefined:1:1043: property missing ':'
// ...
at error (node_modules/jest-styled-components/node_modules/css/lib/parse/index.js:62:15)
at getCSS (node_modules/jest-styled-components/src/utils.js:32:26)
at getStyle (node_modules/jest-styled-components/src/styleSheetSerializer.js:75:15)
at Object.print (node_modules/jest-styled-components/src/styleSheetSerializer.js:135:19)
at printPlugin (node_modules/pretty-format/build/index.js:316:16)
at prettyFormat (node_modules/pretty-format/build/index.js:532:16)
at __EXTERNAL_MATCHER_TRAP__ (node_modules/expect/build/index.js:342:30)
at Object.toMatchSnapshot (node_modules/expect/build/index.js:343:15)
at Object.<anonymous> (/*path__to__my__snapshot__test.js:14:20*/)
It works fine if I replace the ?? with a ||. Both props.paddingLeft and props.theme.smallSpace are non-empty strings in this test.
I don't know if this package should try to handle this or not, but here goes. If I write a style that uses the nullish coalescing operator, Jest complains:
It works fine if I replace the
??
with a||
. Bothprops.paddingLeft
andprops.theme.smallSpace
are non-empty strings in this test.