Unit testing is great: it’s the best way to see if an algorithm does the right thing every time, or to check our input validation logic, or data transformations, or any other isolated operation. Unit testing is perfect for fundamentals.
But front-end code isn’t about manipulating data. It’s about user events and rendering the right views at the right time. Front-ends are about users.
Here’s what we want to be able to do:
- Test user events
- Test the response to those events
- Make sure the right things render at the right time
- Run tests in many browsers
- Re-run tests on file changes
- Work with continuous integration systems like Travis
In the ten years I’ve been doing this, I hadn’t found a decent way to test user interaction and view rendering until I started poking at React.
Your new post is loading...