MCPcopy
hub / github.com/visgl/deck.gl / testInitializeLayerAsync

Function testInitializeLayerAsync

modules/test-utils/src/lifecycle-test.ts:107–128  ·  view source on GitHub ↗
(
  opts: InitializeLayerTestOptions & {
    /** Automatically finalize the layer and release all resources after the test */
    finalize?: boolean;
  }
)

Source from the content-addressed store, hash-verified

105}>;
106
107export async function testInitializeLayerAsync(
108 opts: InitializeLayerTestOptions & {
109 /** Automatically finalize the layer and release all resources after the test */
110 finalize?: boolean;
111 }
112): Promise<{
113 /** Finalize the layer and release all resources */
114 finalize: () => void;
115} | null> {
116 const layerManager = initializeLayerManager(opts);
117 const deckRenderer = new DeckRenderer(device);
118 while (!opts.layer.isLoaded) {
119 await update({layerManager, deckRenderer, oldResourceCounts: {}});
120 }
121 if (opts.finalize === false) {
122 return {
123 finalize: () => layerManager.finalize()
124 };
125 }
126 layerManager.finalize();
127 return null;
128}
129
130/** Spy object compatible with both vitest and probe.gl */
131export type Spy = {

Callers 1

Calls 3

initializeLayerManagerFunction · 0.85
updateFunction · 0.70
finalizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…