(
opts: InitializeLayerTestOptions & {
/** Automatically finalize the layer and release all resources after the test */
finalize?: boolean;
}
)
| 105 | }>; |
| 106 | |
| 107 | export 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 */ |
| 131 | export type Spy = { |
no test coverage detected
searching dependent graphs…