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

source-academy / js-slang / 5936042370

22 Aug 2023 07:58AM UTC coverage: 83.014% (+0.1%) from 82.893%
5936042370

Pull #1471

github

web-flow
Merge 6d88e2972 into 1d991166b
Pull Request #1471: Use Asynchronous Code for Loading Modules

3618 of 4779 branches covered (75.71%)

Branch coverage included in aggregate %.

269 of 269 new or added lines in 23 files covered. (100.0%)

10838 of 12635 relevant lines covered (85.78%)

106101.79 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) {
147!
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