Until now, we have explored React's components lifecycle, properties, state, validations, and ECMAScript with respect to React 0.1.13 and future versions. In this chapter, we will explore the testing of JavaScript and ReactJS-related stuffs. First, we will be going through the testing as a whole using different JavaScript test frameworks and how we can run the tests, followed by testing views build with the ReactJS library.
The following are the things we will be covering in this chapter:
Testing in JavaScript using Chai and Mocha
ReactTestUtils to test React components
Exploring Jest
Testing React-based app using Expect, Mocha, and Shallow rendering
There are various ways that you can mix and match while testing JavaScript. Let's have a brief overview of the various things such as frameworks, assertion libraries, and testing tools. The list given here is not an exhaustive one, and covering all of them in detail is beyond the scope of this book.
Mocha and Jasmine...