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

source-academy / js-slang / 14527354118

pending completion
14527354118

Pull #1745

github

web-flow
Merge b45dab2e1 into fea2b4cad
Pull Request #1745: Remove Interpreter and Testing Refactor

3090 of 4358 branches covered (70.9%)

Branch coverage included in aggregate %.

9068 of 11483 relevant lines covered (78.97%)

153062.41 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'
78✔
8

9
export class AssertionError extends RuntimeSourceError {
78✔
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 {
78✔
24
  if (!condition) {
70,053!
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

© 2026 Coveralls, Inc