mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
feat: Add Typescript types to waitForElement (#21)
Fix types for Flow too
This commit is contained in:
committed by
Michał Pierzchała
parent
d5219d2e93
commit
480dd28cbc
@@ -1,9 +1,9 @@
|
||||
// @flow
|
||||
export default function waitForExpect<T: ReactTestInstance>(
|
||||
export default function waitForExpect<T: *>(
|
||||
expectation: () => T,
|
||||
timeout: number = 4500,
|
||||
interval: number = 50
|
||||
) {
|
||||
): Promise<T> {
|
||||
const startTime = Date.now();
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
const rejectOrRerun = error => {
|
||||
|
||||
Reference in New Issue
Block a user