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

source-academy / js-slang / 5406352152

pending completion
5406352152

Pull #1428

github

web-flow
Merge 0380f5ed7 into 8618e26e4
Pull Request #1428: Further Enhancements to the Module System

3611 of 4728 branches covered (76.37%)

Branch coverage included in aggregate %.

831 of 831 new or added lines in 50 files covered. (100.0%)

10852 of 12603 relevant lines covered (86.11%)

93898.15 hits per line

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

40.0
/src/utils/assert.ts
1
/*
2
 * Why not use the nodejs builtin assert? It needs polyfills to work in the browser.
3
 * With this we have a lightweight assert that doesn't need any further packages.
4
 * Plus, we can customize our own assert messages and handling
5
 */
6

7
import { RuntimeSourceError } from '../errors/runtimeSourceError'
68✔
8

9
export class AssertionError extends RuntimeSourceError {
68✔
10
  constructor(public readonly message: string) {
×
11
    super()
×
12
  }
13

14
  public explain(): string {
15
    return this.message
×
16
  }
17

18
  public elaborate(): string {
19
    return 'Please contact the administrators to let them know that this error has occurred'
×
20
  }
21
}
22

23
export default function assert(condition: boolean, message: string): asserts condition {
68✔
24
  if (!condition) {
13,370!
25
    throw new AssertionError(message)
×
26
  }
27
}
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

© 2025 Coveralls, Inc