MCPcopy
hub / github.com/jestjs/jest / waitUntil

Function waitUntil

e2e/runJest.ts:262–278  ·  view source on GitHub ↗
(fn: ConditionFunction)

Source from the content-addressed store, hash-verified

260 },
261
262 async waitUntil(fn: ConditionFunction) {
263 await new Promise<void>((resolve, reject) => {
264 const check: CheckerFunction = state => {
265 if (fn(state)) {
266 pending.delete(check);
267 pendingRejection.delete(check);
268 resolve();
269 }
270 };
271 const error = new ErrorWithStack(
272 'Process exited',
273 continuousRun.waitUntil,
274 );
275 pendingRejection.set(check, () => reject(error));
276 pending.add(check);
277 });
278 },
279 };
280
281 return continuousRun;

Callers 2

testIn2WorkersFunction · 0.85

Calls 2

setMethod · 0.45
addMethod · 0.45

Tested by 1

testIn2WorkersFunction · 0.68