2
3 Comments

Writing Developer-Friendly React Unit Tests

I have put together a write-up on testing React components with no React Testing Library in place.

It tries to follow best practices with a pinch of clarity on top.

https://webup.org/blog/writing-developer-friendly-react-component-tests/

Maybe it's opinionated. Would you test that way?

  1. 2

    Excellent, Miroslav!

    I've been looking for an uncluttered testing process without all the workarounds. And yours is more conversational than most I have seen. I am going to give this a try with the MeteorJS and NextJS React components that I write. Thank you for such a clear example set.

    1. 1

      Thanks for the kind words. I have been using this approach of testing for the past 5 years in React.

      The post itself is a light version of another write-up I published for css-tricks.com. It covers more examples and theory.

      1. 2

        Hi Miroslav,
        I am reading the CSS-Tricks post now. I appreciate the expanded content. I'll try to let you know as soon as I test it in detail.

Trending on Indie Hackers
After 10M+ Views, 13k+ Upvotes: The Reddit Strategy That Worked for Me! 39 comments Getting first 908 Paid Signups by Spending $353 ONLY. 19 comments 🔥Roast my one-man design agency website 18 comments Launch on Product Hunt after 5 months of work! 16 comments Started as a Goodreads alternative, now it's taking a life of its own 12 comments I Sold My AI Startup for $1,500 and I'm Really Happy About It 11 comments