Testing

Agenda

Frameworks

Helper libraries

Testing in React

Shallow vs Mount

Testing in Redux

Test Frameworks

Test Frameworks

https://stateofjs.com/2017/testing/results

Helper Libraries

expect

Testing in React

Testing in React

shallow

mount

render

used to render react components to static HTML and analyze the resulting HTML structure.

Full DOM rendering is ideal for use cases where you have components that may interact with DOM APIs, or may require the full lifecycle in order to fully test the component (i.e., componentDidMount etc.)

Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that your tests aren't indirectly asserting on behavior of child components.

Testing in Redux

Testing in React

Testing in React + Redux

By Piero Divasto

Testing in React + Redux

  • 561