I have a React application and I added tests with jest and enzyme. I make a unit test for a react component called <Duration.jsx />
.
And the coverage shows me all components coverage inside <Duration.jsx />
and files.scss. Is it normal?
1
votes
1 Answers
0
votes
I think this depends on how you write your tests. IMHO, the coverage is a by-product of tests. For example, if you use enzyme
and shallow(<LayoutMessage />)
, then you are not going to render the children of LayoutMessage
.
If you render normally using render(<LayoutMessage />)
then you will also render the children of LayoutMessage
, increasing the lines that your tests execute.
collectCoverageFrom
- skyboyer