github testing-library/dom-testing-library v8.0.0

latest releases: v10.3.0, v10.2.0, v10.1.0...
3 years ago

8.0.0 (2021-06-23)

Recommendations

  1. If you're using jest fake timers make sure you use modern timers
    jest 27:
    -jest.useFakeTimers('legacy')
    +jest.useFakeTimers('modern')
     // jest.config.js
    -"timers": "legacy",
    +"timers": "modern",
    jest 26:
    -jest.useFakeTimers()
    +jest.useFakeTimers('modern')
     // jest.config.js
    -"timers": "legacy",
    +"timers": "modern",

chore

BREAKING CHANGES

  • Remove deprecated waitFormDOMChange
  • Remove deprecated waitForElement
  • The timeout in waitFor(callback, { interval, timeout } ) now uses the same clock as interval. Previously timeout was always using the real clock while interval was using the global clock which could've been mocked out. For the old behavior I'd recommend waitFor(callback, { interval, timeout: Number.POSITIVE_INFINITY }) and rely on your test runner to timeout considering real timers.
  • <script />, <style /> and comment nodes are now ignored by default in prettyDOM .If you whish to return to the old behavior, use a custom filterNode function. In this case prettyDOM(element, { filterNode: () => true }).
  • node 10 is no longer supported. It reached its end-of-life on 30.04.2021.

Don't miss a new dom-testing-library release

NewReleases is sending notifications on new releases.