3 ms·
I've generally preferred integration tests to unit tests but Storybook has completely changed how I write React components, for the better.
by yodon 7y ago
I've generally preferred integration tests to unit tests but Storybook has completely changed how I write React components, for the better.
- notus 7y agoAgreed on integration tests over unit tests. I get the most bang for my buck with them. Storybook is pretty nice. I use it for developing smaller components, more of the building blocks of the application. Have you ever checked out Kent C Dodd's react-testing-library? It was a refreshing approach to testing react components IMO and it has gained quite a bit of adoption.
- yodon 7y agoThe docs for react-testing-library look like they offer a great deal of wisdom in a tiny package. I find my React components tend to be simple enough that I'm generally far more concerned about whether the CSS works than the JS, leading me to probably keep my focus on Storybook for the moment but I suspect I'll be reaching for react-testing-library before too long. Thanks for the heads up about it.