MCPcopy
hub / github.com/redis/node-redis / waitTillBeenCalled

Function waitTillBeenCalled

packages/client/lib/test-utils.ts:179–190  ·  view source on GitHub ↗
(spy: SinonSpy)

Source from the content-addressed store, hash-verified

177};
178
179export async function waitTillBeenCalled(spy: SinonSpy): Promise<void> {
180 const start = process.hrtime.bigint(),
181 calls = spy.callCount;
182
183 do {
184 if (process.hrtime.bigint() - start > 1_000_000_000) {
185 throw new Error('Waiting for more than 1 second');
186 }
187
188 await setTimeout(50);
189 } while (spy.callCount === calls);
190}
191
192export const BLOCKING_MIN_VALUE = (
193 utils.isVersionGreaterThan([7]) ? Number.MIN_VALUE :

Callers 2

index.spec.tsFile · 0.90
index.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected