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

Function checkRealTimersCallback

src/wait-for.ts:143–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142
143 function checkRealTimersCallback() {
144 if (jestFakeTimersAreEnabled()) {
145 const error = new Error(
146 `Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830`,
147 );
148 copyStackTraceIfNeeded(error, stackTraceError);
149 return onDone({ type: 'error', error });
150 } else {
151 return checkExpectation();
152 }
153 }
154
155 function checkExpectation() {
156 /* istanbul ignore next */

Callers

nothing calls this directly

Calls 4

jestFakeTimersAreEnabledFunction · 0.90
copyStackTraceIfNeededFunction · 0.90
onDoneFunction · 0.85
checkExpectationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…