Using AirBnb's Enzyme to Test React Components

preview_player
Показать описание
Now that we have Enzyme, mocha, and except set up, we will write our first unit tests for our React component (shallow rendering).

Enzyme is an open source library from AirBnb's engineering team. It is a great utility for testing React components that makes it easier to assert, manipulate, and traverse your React Components' output.

Enzyme has a great API that is comparable to jQuery that makes unit testing React components much simpler and more fun.
Рекомендации по теме
Комментарии
Автор

Awesome tutorial! You did a great job of demonstrating the essentials of Enzyme, and also showing a solid methodology for writing good tests.

seanclancy
Автор

really great tut, straight forward and to the point. awesome work

Spade
Автор

Very nice. Long time from the last video.

mikavesasto
Автор

Hi, thanks for great tutorial. In tdd, people write test before write the code for component. Is it normal that you write the code and then write the test?

MrDang