Understanding how react-testing-library works with Kent C. Dodds

Share this video with your friends

Send Tweet

Kent walks us through the internals of dom-testing-library and react-testing-library.

There is a lot of set-up and tear down when testing UI components. These two libraries take away a lot of the work required to test React components well.

Jest is commonly used in tandem with react-testing-library to assert results of your components. Jest simulates most browser apis with jsdom. react-testing-library helps you get values out of your components the same way your end users will.

Links from the show:

Jorge Luis
Jorge Luis
~ 5 years ago

Hey, great talk! really helpfull, but sad you forgot to talk about act() function. I'm not sad really. ¿Could you please give some clue about what it does? Thanks!

Joel Hooks
Joel Hooks(instructor)
~ 5 years ago

Sure, here you go https://reactjs.org/docs/test-utils.html#act

Thanks,

Joel

Dominik Sipowicz
Dominik Sipowicz
~ 5 years ago

Amazing! Thanks both Kent and Joel!