MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / stubDeferredFetch

Function stubDeferredFetch

src/store/reconstructionStore.test.ts:437–449  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

435 // Registers a controllable fetch per URL so tests can resolve/reject lazy
436 // splat downloads out of order.
437 function stubDeferredFetch(): Map<string, { resolve: (r: Response) => void; reject: (e: unknown) => void }> {
438 const deferreds = new Map<string, { resolve: (r: Response) => void; reject: (e: unknown) => void }>();
439 vi.stubGlobal(
440 'fetch',
441 vi.fn(
442 (url: string) =>
443 new Promise<Response>((resolve, reject) => {
444 deferreds.set(url, { resolve, reject });
445 })
446 )
447 );
448 return deferreds;
449 }
450
451 function threeLazySources() {
452 const fileA = new File(['a'], 'a.ply');

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected