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

Function testInitializeLayer

modules/test-utils/src/lifecycle-test.ts:69–86  ·  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

67};
68
69export function testInitializeLayer(
70 opts: InitializeLayerTestOptions & {
71 /** Automatically finalize the layer and release all resources after the test */
72 finalize?: boolean;
73 }
74): {
75 /** Finalize the layer and release all resources */
76 finalize: () => void;
77} | null {
78 const layerManager = initializeLayerManager(opts);
79 if (opts.finalize === false) {
80 return {
81 finalize: () => layerManager.finalize()
82 };
83 }
84 layerManager.finalize();
85 return null;
86}
87
88/** Test that initializing a layer does not throw.
89 * Resolves when the layer's isLoaded flag becomes true.

Callers 8

json-layer.spec.jsFile · 0.90
coreLayersBenchFunction · 0.90
layer.spec.tsFile · 0.85

Calls 2

initializeLayerManagerFunction · 0.85
finalizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…