It was a few months ago that my friend and mentor for testing react apps. Ever since then, I no longer just love the idea of testing UIs, but actually love testing them. I have literally dug out and tested all the UI code I gave up on testing because of its complexity :).
In my experience-based opinion, the react-testing-library is the panacea for all UI test issues. It is not just a testing tool, it is a testing approach.
Note: If your’re not a React person, there is , and , all built on top of the .
The best feature of the react-testing-library is probably its support of UI TDD. According to the docs, it’s is:
The more your tests resemble the way your software is used, the more confidence they can give you.This is the “approach” I’m talking about. Test your UIs just as your non-techie friend would. Your user probably neither knows nor cares what your code looks like. And nor should your test. That gives us the power to use TDD on our UIs.
This is how we’re going to write our socket.io-client test — test everything without thinking about the code. Now let’s do it!
Helping aspiring developers to reach new height.