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

Function finalizeWaitFor

src/wait-for.ts:104–127  ·  view source on GitHub ↗
({ rejectOnAbort = false } = {})

Source from the content-addressed store, hash-verified

102 }
103
104 function finalizeWaitFor({ rejectOnAbort = false } = {}) {
105 /* istanbul ignore next */
106 if (finished) {
107 return;
108 }
109
110 finished = true;
111
112 removeFromCleanupQueue(cleanupQueueCallback);
113
114 if (rejectOnAbort) {
115 reject(new Error('waitFor was aborted by cleanup'));
116 }
117
118 if (overallTimeoutTimer) {
119 clearTimeout(overallTimeoutTimer);
120 overallTimeoutTimer = null;
121 }
122
123 if (intervalId) {
124 clearInterval(intervalId);
125 intervalId = null;
126 }
127 }
128
129 function onDone(done: { type: 'result'; result: T } | { type: 'error'; error: unknown }) {
130 if (finished) {

Callers 2

cleanupQueueCallbackFunction · 0.85
onDoneFunction · 0.85

Calls 1

removeFromCleanupQueueFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…