How 'displayName' Helps In Testing React Using Styled Componentsby@anuradha15
2,854 reads

How 'displayName' Helps In Testing React Using Styled Components

April 10th 2020
2 min
by @anuradha15 2,854 reads
tldt arrow
Read on Terminal Reader

Too Long; Didn't Read

How 'displayName' Helps In Testing React Using Styled Components reads: "How to get rid of the weird styled component names in test snapshots" Anuradha Kumari is a Frontend Consultant, Accessibility advocate and front-end consultant. The displayName provided by React is a recommended feature which helps a lot with unit testing as well as debugging the code. We can solve all the issues as mentioned above by just specifying displayName for all the styled components in the test file.

Company Mentioned

Mention Thumbnail
featured image - How 'displayName' Helps In Testing React Using Styled Components
Anuradha Kumari HackerNoon profile picture

@anuradha15

Anuradha Kumari

About @anuradha15
LEARN MORE ABOUT @ANURADHA15'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart
Anuradha Kumari HackerNoon profile picture
by Anuradha Kumari @anuradha15.Frontend Consultant, GDE, MVP, MDE, Accessibility advocate, https://anuradhakumari.com/
Read My Stories

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa