-
Approaches to Testing React Components
http://reactkungfu.com/2015/07/approaches-to-testing-react-components-an-overview/
A great starting point to testing, looking at the main ways you can test component structure and state handling -
Simple React/Redux Testing
https://medium.com/@caljrimmer/simple-react-redux-testing-cd579d4c2103
Looks at how to test rendering, behavior, and state of an application -
Test Driven React Tutorial
http://spencerdixon.com/blog/test-driven-react-tutorial.html
Describes project setup and basic approaches, using the common stack of Webpack+Karma+Mocha+Chai+Sinon -
How to Test React.js Components
https://nemisj.com/how-to-test-react-js-components/
Covers what to test, and how to test things like props and shallow rendering -
Unit Testing a Redux App
https://www.codementor.io/reactjs/tutorial/redux-unit-test-mocha-mocking
Example ways to test pieces of a Redux app, including actions, reducers, and middleware -
React-Boilerplate Testing Docs
https://github.com/mxstbr/react-boilerplate/blob/v3.0.0/docs/testing/unit-testing.md
https://github.com/mxstbr/react-boilerplate/blob/v3.0.0/docs/testing/component-testing.md
Useful description of how to use Mocha, Expect, and Enzyme to test React and Redux code -
Testing React Applications
http://12devsofxmas.co.uk/2015/12/day-2-testing-react-applications/
A long, in-depth article describing approaches and use of Tape, React TestUtils, and Enzyme -
TDD and React Components
https://medium.com/@nackjicholsonn/tdd-and-react-components-5ae5a9a5a7bf
Detailed example of using TDD to design and develop a React component, using Teaspoon for testing -
Testing Redux Applications
http://randycoulman.com/blog/2016/03/15/testing-redux-applications/
http://randycoulman.com/blog/categories/getting-testy/
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. -
Testing with Mocha and Webpack
http://randycoulman.com/blog/2016/03/22/testing-with-mocha-and-webpack/
http://randycoulman.com/blog/2016/04/05/more-on-testing-with-mocha-and-webpack/
Some excellent information on setting up a good test environment, including use of the mocha-webpack tool. -
Testing React Components with Teaspoon and Unexpected
http://dchambers.github.io/articles/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
http://pebblecode.com/blog/react-redux-unit-testing/
Some basic examples for testing reducers and components. -
Getting Started with TDD in React
https://semaphoreci.com/community/tutorials/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
https://youtu.be/KBhHsYlF4mQ
A fantastic talk that goes through many important details of trying to test React components under JSDOM. -
Testing in React: Getting Off the Ground
https://medium.com/javascript-inside/testing-in-react-getting-off-the-ground-5f569f3088a
A look at approaches and ways to start testing React components -
Testing React and Redux
http://silvenon.com/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. -
Testing React Applications Examples
https://github.com/mxstbr/react-testing
A repo showcasing how to test various parts of a common React/Redux app using Mocha, expect and enzyme -
Unit Testing Redux Container Components
http://pebblecode.com/blog/testing-redux-containers/
Demonstrates techniques for properly testing Redux-connected React components using a mock store. -
React TDD Guide
https://github.com/zpratt/react-tdd-guide
A repo with step-by-step commits demonstrating approaches to testing React apps -
Unit Testing React Components that use Redux
http://www.thereformedprogrammer.net/unit-testing-react-components-that-use-redux/
Tips on unit testing components that render more Redux-connected components -
Generative Testing using Redux: Reducers
https://medium.com/javascript-inside/generative-testing-your-redux-reducers-326d7368f284
A look at using "generative testing" to autoomatically test reducers with varying inputs -
Some Thoughts on Testing React/Redux Applications
https://medium.com/javascript-inside/some-thoughts-on-testing-react-redux-applications-8571fbc1b78f
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
https://medium.com/@kensodev/test-driving-a-change-to-a-react-redux-application-step-by-step-6c8856e7644c
Demonstrates a TDD approach to reworking a Redux app feature -
Idiomatic React Testing Patterns
https://gist.github.com/joshdover/235714771d94509a83609b16d232014a
https://news.ycombinator.com/item?id=12087437
Several useful patterns for testing React components, with discussion on HN. -
A Step-by-Step TDD Approach on Testing React Components using Enzyme
http://thereignn.ghost.io/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
https://www.sitepoint.com/test-react-components-jest/
An in-depth look at how to set up and use Jest for testing -
Testing with Jest Snapshots: First Impressions
http://benmccormick.org/2016/09/19/testing-with-jest-snapshots-first-impressions/
Description of the pros and cons of using Jest's new Snapshot Testing feature -
Jest Testing Resources
https://facebook.github.io/jest/blog/2016/07/27/jest-14.html
https://facebook.github.io/jest/blog/2016/10/03/jest-16.html
Announcements of updates to the Facebook Jest testing tool, with links to further articles and information. -
Migrating Ava to Jest
http://browniefed.com/blog/migrating-ava-to-jest/
Some quick tips on switching your testing config to use Jest -
React UI Testing with Storybook
https://getstorybook.io/docs/testing/react-ui-testing
Looks at using the React Storybook component editor to do UI testing -
Testing React Components with mocha-webpack
https://medium.com/@mmontoya/testing-reactjs-components-with-mocha-webpack-ce7f710d268c
Looks at how mocha-webpack can be used to enable faster testing for React components -
Testing React Components with Enzyme and Mocha
https://ifelse.io/2016/04/04/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
https://daveceddia.com/testing-for-proptypes-errors/
Some quick examples that use Sinon to check for error logging to help verify correct prop usage during testing. -
What to Test in a React App
https://daveceddia.com/what-to-test-in-react-app/
General guidance on what types of tests you might want to write and what to test for. -
Testing React Applications
https://www.youtube.com/watch?v=59Ndb3YkLKA
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
https://medium.com/@TuckerConnelly/good-practices-for-testing-react-apps-3a64154fa3b1
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
https://hackernoon.com/testing-react-components-with-jest-and-enzyme-41d592c174f
Examples of how to use Jest's snapshot testing and Enzyme's component API to write component tests -
Testing with Webpack 2, inject-loader, Karma, Mocha, Chai, and More
https://cafedev.org/article/2016/12/testing-with-wepack-2-inject-loader-karma-mocha-chai-and-sinon/
Examples of using these tools to test some complex code, including mocking out dependencies -
Best practices for testing React components using Mocha, Chai, and Enzyme
https://reflect.io/blog/js-testing-mocha-chai-enzyme/
A number of useful tips for improving component tests, including use of shallow rendering, avoiding errors while testing, and making test code consistent
-
Javascript Testing: Unit vs Functional vs Integration
https://www.sitepoint.com/javascript-testing-unit-functional-integration/
A comparison of the various levels of tests you can run, and what roles they play in development. -
Reddit - "Karma/Mocha/Chai/Sinon setup"
https://www.reddit.com/r/javascript/comments/4217x6/ive_spent_six_hours_attempting_to_set_up/
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. -
Setting Up Javascript Testing Tools for ES6
http://x-team.com/2016/05/setting-up-javascript-testing-tools-for-es6/
Tips on configuring tools to work with ES6 code, and writing tests using ES6 -
Keep Calm and Love Javascript Unit Tests - Part 2: Asynchronism
http://www.theodo.fr/blog/2016/06/keep-calm-and-love-javascript-unit-tests-part-2-asynchronism/
Useful tips for testing asynchronous behavior under Mocha. -
ESLint Part 1: Exploration
https://blog.scottnonnenberg.com/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. -
Keep Calm and Love Javascript Unit Tests
http://www.theodo.fr/blog/2016/04/keep-calm-and-love-javascript-unit-tests-part-1/
http://www.theodo.fr/blog/2016/06/keep-calm-and-love-javascript-unit-tests-part-2-asynchronism/
An introduction to using Mocha, Chai, and Sinon to write unit tests for various scenarios. -
UI Testing at Urban Airship
https://github.com/urbanairship/technical-blog/blob/master/AirshipUITesting.md
In-depth discussion of complexities and approaches for testing real-world UI code, including test runners, mocking, and more. -
Migrating to Jest
https://medium.com/@kentcdodds/migrating-to-jest-881f75366e7e
Kent C. Dodds describes why and how his team at Paypal switched their test setup to use Jest instead of Ava. -
Web Application Test Strategy
https://blog.scottnonnenberg.com/web-application-test-strategy/
Thoughts on a "test pyramid" approach to testing, balancing speed and results between unit tests, integration tests, and automation.