MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / withImmediateTimers

Function withImmediateTimers

packages/sync/src/pull-engine.test.ts:28–39  ·  view source on GitHub ↗
(fn: () => Promise<T>)

Source from the content-addressed store, hash-verified

26}
27
28async function withImmediateTimers<T>(fn: () => Promise<T>): Promise<T> {
29 const originalSetTimeout = globalThis.setTimeout
30 ;(globalThis as any).setTimeout = (callback: (...args: any[]) => void) => {
31 callback()
32 return 0
33 }
34 try {
35 return await fn()
36 } finally {
37 globalThis.setTimeout = originalSetTimeout
38 }
39}
40
41function createDataSource(): DataSource {
42 return {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected