• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 23446532725

23 Mar 2026 03:52PM UTC coverage: 73.683% (-0.02%) from 73.701%
23446532725

push

github

web-flow
chore: Use biome for lint and prettier (#2565)

4631 of 7113 branches covered (65.11%)

Branch coverage included in aggregate %.

20 of 24 new or added lines in 10 files covered. (83.33%)

5 existing lines in 3 files now uncovered.

10586 of 13539 relevant lines covered (78.19%)

267.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.0
/modules/test-utils/src/deprecated/sync-test-device.ts
1
// luma.gl
2
// SPDX-License
3
// Copyright (c) vis.gl contributors
4

5
import type {CanvasContextProps} from '@luma.gl/core';
6
import {WebGLDevice} from '@luma.gl/webgl';
7

8
const DEFAULT_CANVAS_CONTEXT_PROPS: CanvasContextProps = {
59✔
9
  width: 1,
10
  height: 1
11
};
12

13
/**
14
 * Create a test WebGLDevice
15
 * @note This WebGL Device is create synchronously and can be used directly but will not have WebGL debugging initialized
16
 * @deprecated Use getWebGLTestDevice().
17
 */
18
export function createTestDevice(): WebGLDevice | null {
19
  if (cachedWebglDevice) {
59!
20
    return cachedWebglDevice;
×
21
  }
22

23
  if (
59!
24
    typeof navigator === 'undefined' ||
177✔
25
    typeof document === 'undefined' ||
26
    typeof HTMLCanvasElement === 'undefined'
27
  ) {
28
    return null;
×
29
  }
30

31
  try {
59✔
32
    // TODO - We do not use luma.createDevice since createTestDevice currently expect WebGL context to be created synchronously
33
    cachedWebglDevice = new WebGLDevice({createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS});
59✔
34
    return cachedWebglDevice;
59✔
35
  } catch (error) {
36
    // eslint-disable-next-line no-console
37
    console.error(`Failed to created device: ${(error as Error).message}`);
×
38
    // biome-ignore lint/suspicious/noDebugger: explicit debug break for synchronous test-device failures.
NEW
39
    debugger;
×
UNCOV
40
    return null;
×
41
  }
42
}
43

44
/**
45
 * A pre-created WebGLDevice
46
 * @note This WebGL Device is create synchronously and can be used directly but will not have WebGL debugging initialized
47
 * @deprecated Use getWebGLTestDevice().
48
 */
49
let cachedWebglDevice: WebGLDevice | null = null;
59✔
50

51
export const webglDevice = createTestDevice();
59✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc