~/talk

Testing Async Components

Talkat Reactathon 2020 · 2020-03-30..03-31· [testing, react]
links:none on file
slides:none on file

Shows concrete recipes for testing async React components: replace a 200ms debounce by fake timers or by rewriting the test as async and using findBy queries / waitFor instead of manual advances. Covers mocking window.fetch, creating an api.js wrapper, or using Mock Service Worker or Mirage to fake network responses, and shows using Cypress + testing-library plugin with cy.intercept for end-to-end paths. Demonstrates when each approach simplifies asserting resolve and reject flows.

AI-written summary · about

  1. 0:00Intro
  2. 0:34Component Testing 101
  3. 1:42Sources of Asynchronicity
  4. 2:15Dealing with Timers
  5. 6:47Dealing with Promises
  6. 7:40Dealing with The Network
  7. 12:00Testing in a Real Browser (Cypress)
~/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.