~/talk

Migrating from Enzyme to React Testing Library

Talkat React Miami 2022 · 2022-04-18..04-19· [react, testing]
slides:none on file

Concrete claim: enzyme breaks on React 17/18 and is effectively dead, so tests need migration. Evidence: an unofficial React 17 adapter gets half a million downloads a week and an 18 adapter proves infeasible after many releases. Tools and patterns shown: enzyme's shallow/mount vs react testing library's full render and query family. Surprising numbers: adapter traffic and 24 releases. Practical changes: rewrite tests to getByRole / findBy and sometimes change source code for accessibility; async and typing become simpler and more reliable.

AI-written summary · about

  1. 0:00Introduction and context
  2. 1:17The end of Enzyme
  3. 4:42React testing library
  4. 5:51Speaker background
  5. 8:44Component rendering
  6. 12:06Querying strategies
  7. 15:54Testing asynchronous code
  8. 21:19Migrating best practices
  9. 22:14Simulating user interactions
  10. 24:29Resources and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.