@@ -4,11 +4,9 @@ import {
44 getQueriesForElement ,
55 prettyDOM ,
66 configure as configureDTL ,
7- waitForElementToBeRemoved as waitForElementToBeRemovedDTL ,
87} from '@testing-library/dom'
98import act from './act-compat'
109import { fireEvent } from './fire-event'
11- import { waitFor } from './wait-for'
1210
1311configureDTL ( {
1412 eventWrapper : cb => {
@@ -20,6 +18,15 @@ configureDTL({
2018 } ,
2119} )
2220
21+ if ( typeof React . startTransition !== undefined ) {
22+ configureDTL ( {
23+ unstable_advanceTimersWrapper : cb => {
24+ return act ( cb )
25+ } ,
26+ asyncWrapper : cb => cb ( ) ,
27+ } )
28+ }
29+
2330// Ideally we'd just use a WeakMap where containers are keys and roots are values.
2431// We use two variables so that we can bail out in constant time when we render with a new container (most common use case)
2532/**
@@ -192,19 +199,9 @@ function cleanup() {
192199 mountedContainers . clear ( )
193200}
194201
195- function waitForElementToBeRemoved ( callback , options ) {
196- return waitForElementToBeRemovedDTL ( ( ) => {
197- let result
198- act ( ( ) => {
199- result = callback ( )
200- } )
201- return result
202- } , options )
203- }
204-
205202// just re-export everything from dom-testing-library
206203export * from '@testing-library/dom'
207- export { render , cleanup , act , fireEvent , waitFor , waitForElementToBeRemoved }
204+ export { render , cleanup , act , fireEvent }
208205
209206// NOTE: we're not going to export asyncAct because that's our own compatibility
210207// thing for people using [email protected] . Anyone else doesn't need it and
0 commit comments