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

source-academy / js-slang / 13964710825

20 Mar 2025 08:12AM UTC coverage: 81.097% (+0.01%) from 81.086%
13964710825

push

github

web-flow
Fix for JSON imports not working (#1752)

* Revert "Remove unneeded compatibility code"

* Revert tests partially

Keep changes for removing commented tests and prettier formatting

3440 of 4608 branches covered (74.65%)

Branch coverage included in aggregate %.

13 of 14 new or added lines in 1 file covered. (92.86%)

10786 of 12934 relevant lines covered (83.39%)

145928.18 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'
77✔
8

9
export class AssertionError extends RuntimeSourceError {
77✔
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 {
77✔
24
  if (!condition) {
843!
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