MCPcopy
hub / github.com/callstack/react-native-testing-library / waitFor

Function waitFor

src/wait-for.ts:222–228  ·  view source on GitHub ↗
(expectation: () => T, options?: WaitForOptions)

Source from the content-addressed store, hash-verified

220}
221
222export function waitFor<T>(expectation: () => T, options?: WaitForOptions): Promise<T> {
223 // Being able to display a useful stack trace requires generating it before doing anything async
224 const stackTraceError = new ErrorWithStack('STACK_TRACE_ERROR', waitFor);
225 const optionsWithStackTrace = { stackTraceError, ...options };
226
227 return wrapAsync(() => waitForInternal(expectation, optionsWithStackTrace));
228}

Callers 7

findAllByQueryFunction · 0.90
findByQueryFunction · 0.90
timers.test.tsFile · 0.90
input.tsxFile · 0.85
expected.tsxFile · 0.85
wait-for.test.tsxFile · 0.85

Calls 2

wrapAsyncFunction · 0.90
waitForInternalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…