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

source-academy / js-slang / 6107141959

07 Sep 2023 08:11AM UTC coverage: 82.853% (+0.2%) from 82.683%
6107141959

push

github

web-flow
Use Asynchronous Code for Loading Modules (#1471)

* Add async loading code

* Made infinite loop checking async

* Update stepper to be async

* Add assert and misc utils

* Update transpiler to be async

* Update runners

* Add new import options

* Ignore tests during typechecking

* Relocate typeguards

* Update with assertions and typeguards

* Update repl transpiler to be async

* Abstract out module context initialization and tab loading

* Renamed promise timeout error and added tests

* Remove old code

* Update options

* Add files to avoid line ending issues

* Use POSIX paths on Windows systems

* Ran format

* Update eslint rules to follow exclusion of tests

* Incorporate changes for posix path handling

* Minor change to resolve certain webpack issues with the frontend

* Use a different posix path import

* Allow loading of export default tabs

* Refactor collation of import declarations

---------

Co-authored-by: Ian Yong <ianyongyc@gmail.com>

3629 of 4814 branches covered (0.0%)

Branch coverage included in aggregate %.

266 of 266 new or added lines in 25 files covered. (100.0%)

10886 of 12705 relevant lines covered (85.68%)

96881.51 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

© 2026 Coveralls, Inc