Packages

@testing-library/dom

10.4.2 · 13 Sep 2026MIT125.9M / weekRepositoryHomepagenpmAtom feed

Your version

7.17.0

23 Jun 2020Where it was published

7.31.2 is the newest release of 7.x.

In short

1 new

Release note

Features

  • waitFor: add complete support for fake timers (#662) (5b2640a), closes #661

🚨 It's possible this will break your tests if you were working around our limitations before. Fixing the issue should be straightforward. Here's an example from my (Kent's) own workaround:

  // using fake timers to skip debounce time
  jest.useFakeTimers()
  userEvent.clear(notesTextarea)
  userEvent.type(notesTextarea, newNotes)
- act(() => jest.runAllTimers())

  await screen.findByLabelText(/loading/i)
  // wait for the loading spinner to go away
  await waitForLoadingToFinish()

  jest.useRealTimers()

Notice that all I needed to change was removing manually advancing timers because now we handle things automatically for you 🎉

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.