React and Components
Approaches to Testing React Components
A great starting point to testing, looking at the main ways you can test component structure and state handling
Test Driven React Tutorial
Describes project setup and basic approaches, using the common stack of Webpack+Karma+Mocha+Chai+Sinon
How to Test React.js Components
Covers what to test, and how to test things like props and shallow rendering
Testing React Applications
A long, in-depth article describing approaches and use of Tape, React TestUtils, and Enzyme
TDD and React Components
Detailed example of using TDD to design and develop a React component, using Teaspoon for testing
What to Test in a React App
General guidance on what types of tests you might want to write and what to test for.
Testing React Applications
A presentation by Max Stoiber, looking at what types of things to test in a React/Redux application, and ways to use tools like Jest to speed up the testing process.
Good Practices for Testing React Apps
Thoughts on writing end-to-end tests, unit tests, and integration tests for Reaact applications, including treating components as "black boxes".
Testing React components with Jest and Enzyme
Examples of how to use Jest's snapshot testing and Enzyme's component API to write component tests
Best practices for testing React components using Mocha, Chai, and Enzyme
A number of useful tips for improving component tests, including use of shallow rendering, avoiding errors while testing, and making test code consistent
The Right Way to Test React Components
Excellent advice on how to determine a component's "contract", what aspects of that are worth testing, and how to approach testing that contract.
Testing React Components with Teaspoon and Unexpected
A short but useful look at a couple testing libraries and ways to use them.
Unit Testing React Components and Redux Reducers
￼ Some basic examples for testing reducers and components.
Getting Started with TDD in React
Covers a typical Mocha+Chai+JSDOM+Enzyme setup, talks about why/how/what to test, and walks through several examples.
Testing React Applications
A fantastic talk that goes through many important details of trying to test React components under JSDOM.
Testing in React: Getting Off the Ground
A look at approaches and ways to start testing React components
Testing React Applications Examples
A repo showcasing how to test various parts of a common React/Redux app using Mocha, expect and enzyme
React TDD Guide
A repo with step-by-step commits demonstrating approaches to testing React apps
Idiomatic React Testing Patterns
Several useful patterns for testing React components, with discussion on HN.
A Step-by-Step TDD Approach on Testing React Components using Enzyme
An excellent article covering TDD, React, and Enzyme.
How to Test React Components Using Jest
An in-depth look at how to set up and use Jest for testing
React UI Testing with Storybook
Looks at using the React Storybook component editor to do UI testing
Testing React Components with mocha-webpack
Looks at how mocha-webpack can be used to enable faster testing for React components
Testing React Components with Enzyme and Mocha
Examples of setting up a Webpack+Mocha test environment, and using Enzyme for implementing tests
Testing for PropType Errors in React
Some quick examples that use Sinon to check for error logging to help verify correct prop usage during testing.
Testing React Applications
Describes several types of unit tests that can be written in a React app (component tests, component tests, storybook tests), and the intent and benefits of each.
Testing React Applications with Jest
An in-depth explanation of how to use Jest for React testing, including setup, basic test structure, using Enzyme for rendering React components, mocking, and more.
Never render in React testing again
Some examples of using higher-order functions to simplify test logic
React + TDD = Love
A tutorial that walks through a TDD-based approach to building components in an application.
Snapshot Testing React with Jest
An excellent explanation of what "snapshot testing" is, and how to apply it to test React components using Jest
React and Redux Testing with Jest: How Some Jokers Learned to Take Snapshots
Discussion of how Jest snapshot tests can be used to replace some manually-written tests for both React components and Redux logic.
A Practical Guide to Testing React Apps
An excellent, comprehensive guide to React testing, covering some of the major tools, types of tests, how to write good React tests, and more.
Testing React Components https://nerdblog.pl/post/166842840969/testing-react-components
An extensive look at different ways to test React components using the Enzyme library. Discusses Enzyme's shallow and full rendering methods, methods to inspect the contents of a component, and different forms of tests like snapshots, rendering tests, and behavior tests.
Creating a React Component using TDD
Demonstrates writing a simple React component using the TDD "red-green" testing approach.
Unit Testing with Semantic-UI-React and Enzyme
Specific tips and advice for testing components that use the Semantic-UI-React library, including advice on focusing your tests on your own components' behavior. The tips are also applicable to React component testing in general.
Implementing basic Component tests using Jest and Enzyme
Describes the Jest and Enzyme tools, how they're used for testing React components, and gives examples of some simple tests.
Snapshot testing React Components with Jest
Covers the basics of snapshot testing, and how it can be used to test React components to ensure the rendering is consistent.
Testing React Components
Thoughts on good practices for testing React components, based on writing thousands of tests. Describes complexities in testing real-world components that make use of multiple HOCs or that glue different units together, and how the Cosmos tool can help simplify those tests using mocking.
An introduction to testing React components with Enzyme 3
Introduces the Enzyme library for testing components, and shows a short TDD approach for writing a component
Unit test code that uses CSS Modules
Provides several solutions for handling imports of CSS Modules when running unit tests
Testing React components using render props
Kent C Dodds gives several examples and suggestions of approaches for testing components that make use of render props.
Lessons learned testing React & Redux apps with Jest and Enzyme
Thoughts on best practices based on experience, including complexities of setting up a testing environment, optimal setup for snapshot tests, simplifying test setup, and what aspects of Redux code should be tested.
Integration Testing React and Redux with Mocha and Enzyme
Tips on dealing with larger-scale integration tests of React apps under Mocha. Discusses handling async API calls, using
mocha-stepsfor multi-step tests, and working with React-Router.
Simple React/Redux Testing
Looks at how to test rendering, behavior, and state of an application
Unit Testing a Redux App
Example ways to test pieces of a Redux app, including actions, reducers, and middleware
React-Boilerplate Testing Docs
Useful description of how to use Mocha, Expect, and Enzyme to test React and Redux code
Testing Redux Applications
A great writeup on how to specifically deal with testing pieces of a Redux app. The "Getting Testy" post series also has a lot of really good idea on how to go about writing tests and what kinds of things should be tested.
Unit Testing Redux Container Components
Demonstrates techniques for properly testing Redux-connected React components using a mock store
Testing React and Redux
A three-part article that shows how to set up Ava and Babel, then walks through testing Redux code (action creators, reducers, selectors, thunks, and sagas), and React components.
Unit Testing React Components that use Redux
Tips on unit testing components that render more Redux-connected components
Generative Testing using Redux: Reducers
A look at using "generative testing" to autoomatically test reducers with varying inputs
Some Thoughts on Testing React/Redux Applications
Guidelines and best practices for what and how to test in a React/Redux app
Test Driving a change to a Redux application - Step by Step
Demonstrates a TDD approach to reworking a Redux app feature
Workship Slides: React and Redux Testing
A slideshow that gives a helpful overview of the React Test Utilities and Enzyme to test React components
Low effort, high value: Integration tests in Redux apps
A discussion of the benefits of unit tests vs integration tests, with examples of how to test the various aspects of a Redux app
Testing React/Redux Applications
Several useful resources for testing, including tips/guidelines, a sample application with tests, and links to more resources.
How to test React and Redux with Redux-Saga and ReactDND
In-depth examples of testing React components using the Teaspoon library, as well as setting up tests for Redux-connected components, Redux-Saga functions, and uses of ReactDND.
Simplify your Redux unit testing using Tape
Some quick examples of using the Tape library to test Redux reducers, with an accompanying example repo
Unit Testing Redux Container Components, Part 1
Some useful tips for setting up tests for Redux-connected components
Code Review: SPA testing with React and Redux
A variety of useful observations and suggestions for testing React+Redux code, including good practices for structuring test setup
Test Your Redux Container with Enzyme
Examples for using Enzyme to test Redux-connected components, including passing in a mock store, use of shallow rendering, and testing
Redux Testing Step by Step: A simple Methodology for Testing Business Logic
An excellent article by Tal Kol, describing how different types of tests fit together, the different kinds of Redux code that need to be tested, and how to write tests for each.
TDDing React + Redux
Helpful examples of patterns for testing various parts of a React+Redux app.
Testing Redux: Async Action Creators
Describes approaches for testing async action creators, particularly thunks that make AJAX calls.
A guide to TDD a React/Redux TodoList App
A 4-part series that demonstrates a Test-Driven Development approach to writing a React/Redux app, with detailed explanations of what each test example does.
Building a React/Redux app with Test Driven Development
A guided walkthrough that shows how to apply TDD to actions, reducers, and services
Testing Replicated Redux
Describes how the use of "property testing" to generate possible actions helped the author track down bugs in his distributed multiplayer Redux application.
Test-Driven Development with React and Redux, using Redux TDD
Describes using a specific set of helper functions to drive testing the behavior and data flow of a React+Redux application.
Writing tests for redux-observable
Quick examples of how to set up tests for redux-observable epics.
End-to-end testing on a React-Redux app
Some high-level thoughts of how to best implement end-to-end testing in a way that works with React-Redux apps. Discusses use of Cypress, real APIs vs mock APIs, and some Rails-specific setup.
How to Snapshot Test Everything in Your Redux App with Jest
Detailed examples of how to test React components, Redux reducers, connected components, and selectors using Jest snapshot tests.
Unit Testing React, Redux, Selectors, and Epics
Quick examples of ways to different parts of a React+Redux app.
Jest Testing Patterns for React-Redux Applications
Includes info on basic Jest test setup, as well as examples of using Jest to test React components, Redux-connected components, actions and reducers, API calls, and React event behavior.
Recipes for Testing Redux Actions and Reducers
Useful examples of testing Redux code, using redux-thunk, chai, axios, redux-mock-store, and axios-mock-adapter.
Unit Testing Redux Connected Components
Discusses testing connected components with a mock store vs testing
mapStatefunctions and plain components separately.
How to Test Your Redux App
Discusses tradeoffs and examples of writing tests for "simple" functions, and how to approach writing integration tests for connected components.
An interview with the author of the redux-saga-test-plan library, discussing how it works and how it can simplify the process of testing sagas.
Subcutaneous Testing against React + .NET Applications
Discusses a possible approach for using the Storyteller .NET integration testing tool to help drive a client-side Redux app for integration testing.
Creating unit tests for redux-observable with marble diagrams
Describes how to set up tests for redux-observable epics, and define expectations for behavior using marble diagrams
How I test redux-saga
Short examples of a typical saga and a test for that saga, with some thoughts on a couple tricks for testing sagas.
Testing strategies for Redux apps
A series of posts describing several strategies for testing Redux apps, including larger integration tests with mock APIs, handling of async logic, routing, and scroll events.
Evaluating Redux Saga Test Libraries
Looks at several ways to approach testing sagas, and how specific saga test helper libraries use those approaches. Includes a helpful table listing which approaches each helper library supports.
Testing mapState, mapDispatch, and connected components
A pair of articles that discuss ways to handle testing the various pieces of connected components.
General Testing, Tools, and Setup
A comparison of the various levels of tests you can run, and what roles they play in development.
Reddit - "Karma/Mocha/Chai/Sinon setup"
Reddit user Cody_Chaos describes his approach to running unit tests under Node with Mocha, and integration tests in a browser with Karma. Includes several useful config setup snippets.
Tips on configuring tools to work with ES6 code, and writing tests using ES6
Useful tips for testing asynchronous behavior under Mocha.
Testing with Mocha and Webpack
Some excellent information on setting up a good test environment, including use of the mocha-webpack tool.
Testing with Webpack 2, inject-loader, Karma, Mocha, Chai, and More
Examples of using these tools to test some complex code, including mocking out dependencies
ESLint Part 1: Exploration
A solid look at what ESLint is, how you can use it to help keep your code clean, and a number of useful linting plugins that are available.
An introduction to using Mocha, Chai, and Sinon to write unit tests for various scenarios.
UI Testing at Urban Airship
In-depth discussion of complexities and approaches for testing real-world UI code, including test runners, mocking, and more.
Migrating to Jest
Kent C. Dodds describes why and how his team at Paypal switched their test setup to use Jest instead of Ava.
Testing with Jest Snapshots: First Impressions
Description of the pros and cons of using Jest's new Snapshot Testing feature
Jest Testing Resources
Announcements of updates to the Facebook Jest testing tool, with links to further articles and information.
Migrating Ava to Jest
Some quick tips on switching your testing config to use Jest
Web Application Test Strategy
Thoughts on a "test pyramid" approach to testing, balancing speed and results between unit tests, integration tests, and automation.
Enzyme vs Unexpected-React
A comparison of how Enzyme and Unexpected-React are used in testing React components, with arguments in favor of Unexpected-React
Jest vs Mocha for React Testing
A comparison of the strengths and weaknesses of the Jest and Mocha testing frameworks
A useful comparison and summary of the major unit testing frameworks available
Effective Snapshot Testing
Kent C Dodds looks at the pros and cons of using snapshot testing, and how to make snapshot tests more useful.
Write tests. Not too many. Mostly integration.
Some short thoughts on the value of different kinds of tests, with extensive discussion in the comments.
Stubbing HTTP Reqeusts with Sinon
An extensive tutorial that discusses the benefits of stubbing behavior in tests, setting up Mocha+Chai+Sinon, and using Sinon's stub functions in integration and unit tests.
What makes a good test?
A variety of short thoughts on why we write unit tests, how to write good tests, and some specific suggestions for working with snapshot tests and tests for async behavior.
Thoughts on the benefits of different types of testing, including code coverage, unit tests for React components, snapshot tests, and integration tests.