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

visgl / luma.gl / 23357510199

20 Mar 2026 06:40PM UTC coverage: 58.158% (+5.9%) from 52.213%
23357510199

push

github

web-flow
chore: Run tests on src instead of dist (#2555)

3021 of 6029 branches covered (50.11%)

Branch coverage included in aggregate %.

7102 of 11377 relevant lines covered (62.42%)

243.33 hits per line

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

40.0
/modules/core/src/utils/assert.ts
1
// luma.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
/** Throws if condition is true and narrows type */
6
export function assert(condition: unknown, message?: string): asserts condition {
7
  if (!condition) {
137!
8
    const error = new Error(message ?? 'luma.gl assertion failed.');
×
9
    Error.captureStackTrace?.(error, assert);
×
10
    throw error;
×
11
  }
12
}
13

14
/** Throws if value is not defined, narrows type */
15
export function assertDefined<T>(value: T | undefined, message?: string): T {
16
  assert(value, message);
137✔
17
  return value;
137✔
18
}
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