1

we decided to add Emotion in an existed project where we have a rule that we need to have 90% tests coverage for all components.

But when we created a few components with @emotion/styled, we see that this affect our coverage because now we have uncovered returns statements in styled components: enter image description here

Is there any way to properly add tests for these @emotion/styled components without checking and listing all CSS properties?

Volodymyr Humeniuk
  • 3,411
  • 9
  • 35
  • 70
  • Coverage doesn't tell you whether or not any of those properties was asserted on, just whether or not that code was executed. If it wasn't, are you not using this wrapper in the code that's being tested? – jonrsharpe Aug 19 '21 at 14:44
  • @jonrsharpe I'm using it, but to be honest I do not quite understand what do I need to test here, if 'styled.button' was called with props and if it's returned an object? – Volodymyr Humeniuk Aug 19 '21 at 15:02

0 Answers0