React Tests

There's no such thing as a bug-free application, every good developer knows that. Tests are your friends with the never ending battle against bugs. In this topic you'll learn a lot about how to test React applications.

7 resources available

How to (unit) test in React

This guide explains what unit testing is, why it's needed and the best practices for small to large React applications. [continue]

Article by Onoufrios Malikkides

End to End testing React applications

Having a good testing setup, one that allows us to create meaningful tests and is not a painful process, is extremely important to produce quality code. In this talk we will explore the options that we have, and will explain how to leverage webdriver for end-to-end testing React applications. [continue]

Video Talk by Forbes Lindesay

A New Way to Handle Events in React

'Property Initializer Syntax' sounds more fancy than it really is. In this bite-sized tutorial see how this alternative way of writing event handlers will help eliminate boilerplate in your constructor and also defend against frivolous memory usage in your renders. [continue]

Article by William Le

Debugging a Create React App with VS Code

In this video we'll look at how to configure VS Code to debug React components and Jest unit tests inside a web application that was created by create-react-app. [continue]

Video Tutorial by Manorisms

The Right Way to Test React Components

There's a lot of confusion right now about the 'right' way to test your React components. Should you write all your tests by hand, or only use snapshots, or some of both? Should you test props? State? Styles/Layout? I don't think there's one 'right' way, but I've found a few patterns and tips that work [continue]

Article by Stephen Scott

An introduction to testing React components with Enzyme 3

In today's post we'll introduce the AirBnB library Enzyme for testing React applications. We'll do this using a test driven development (TDD) approach. That is, we'll write the tests first, watch them fail, and then build the React component out to fix the tests, before then writing more. We'll then [continue]

Article by Jack Franklin

Refactoring React with Tests

As you work on a React application it's highly likely that you'll encounter components that have grown over time. They may have started with just one particular use case in mind, but will have been added to since. This can lead to complex render methods and code that's hard to follow. In this video you'll [continue]

Article by Jack Franklin