Skip to content

Commit ce51eec

Browse files
committed
advanceTimersWrapper -> unstable_advanceTimersWrapper
1 parent d033b55 commit ce51eec

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {prettyDOM} from './pretty-dom'
44
type Callback<T> = () => T
55
interface InternalConfig extends Config {
66
_disableExpensiveErrorDiagnostics: boolean
7-
advanceTimersWrapper(cb: (...args: unknown[]) => unknown): unknown
87
}
98

109
// It would be cleaner for this to live inside './queries', but
@@ -21,7 +20,7 @@ let config: InternalConfig = {
2120
// react-testing-library to use. For that reason, this feature will remain
2221
// undocumented.
2322
asyncWrapper: cb => cb(),
24-
advanceTimersWrapper: cb => cb(),
23+
unstable_advanceTimersWrapper: cb => cb(),
2524
eventWrapper: cb => cb(),
2625
// default value for the `hidden` option in `ByRole` queries
2726
defaultHidden: false,

src/wait-for.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function waitFor(
6464

6565
const wasUsingJestFakeTimers = jestFakeTimersAreEnabled()
6666
if (wasUsingJestFakeTimers) {
67-
const {advanceTimersWrapper} = getConfig()
67+
const {unstable_advanceTimersWrapper: advanceTimersWrapper} = getConfig()
6868

6969
// this is a dangerous rule to disable because it could lead to an
7070
// infinite loop. However, eslint isn't smart enough to know that we're

types/config.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
export interface Config {
22
testIdAttribute: string
3+
/**
4+
* WARNING: `unstable` prefix means this API may change in patch and minor releases.
5+
* @param cb
6+
*/
7+
unstable_advanceTimersWrapper(cb: (...args: unknown[]) => unknown): unknown
38
// eslint-disable-next-line @typescript-eslint/no-explicit-any
49
asyncWrapper(cb: (...args: any[]) => any): Promise<any>
510
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)