MCPcopy Index your code
hub / github.com/callstack/react-native-testing-library / blockThread

Function blockThread

src/__tests__/wait-for.test.tsx:395–404  ·  view source on GitHub ↗
(timeToBlockThread: number, timerType: TimerType)

Source from the content-addressed store, hash-verified

393 const WAIT_FOR_TIMEOUT = WAIT_FOR_INTERVAL * 5;
394
395 const blockThread = (timeToBlockThread: number, timerType: TimerType): void => {
396 jest.useRealTimers();
397 const end = Date.now() + timeToBlockThread;
398
399 while (Date.now() < end) {
400 // do nothing
401 }
402
403 setupTimeType(timerType);
404 };
405
406 const mockErrorFn = jest.fn(() => {
407 // Wait 2 times interval so that check time is longer than interval

Callers 1

wait-for.test.tsxFile · 0.85

Calls 1

setupTimeTypeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…