How 'displayName' Helps In Testing React Using Styled Components

Written by anuradha15 | Published 2020/04/10
Tech Story Tags: tdd | react | styled-components | enzyme | unit-testing | javascript | nodejs | jest

TLDR 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.via the TL;DR App

no story

Written by anuradha15 | Frontend Consultant, GDE, MVP, MDE, Accessibility advocate, https://anuradhakumari.com/
Published by HackerNoon on 2020/04/10