© Adam Freeman 2019
Adam FreemanPro React 16https://doi.org/10.1007/978-1-4842-4451-7_17

17. Unit Testing

Adam Freeman1 
(1)
London, UK
 
In this chapter, I show you how to test React components. I introduce a package that makes testing easier and demonstrate how it can be used to test components in isolation and test their interactions with their children. Table 17-1 puts unit testing in context.
Table 17-1

Putting Unit Testing in Context

Question

Answer

What is it?

React components require special support for testing so that their interactions with other parts of the application can be isolated and inspected.

Why is it useful?

Isolated unit tests are able to assess the basic logic provided by a component without being influenced by the interactions with the ...

Get Pro React 16 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.