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

source-academy / js-slang / 5010913250

pending completion
5010913250

push

github

GitHub
Fix file path in error message when module cannot be found (#1411)

3542 of 4637 branches covered (76.39%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

10588 of 12267 relevant lines covered (86.31%)

90151.63 hits per line

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

62.07
/src/stdlib/inspector.ts
1
import { Node } from 'estree'
2

3
import { Context, Result } from '..'
4
import { Scheduler, Value } from '../types'
5

6
export const saveState = (
66✔
7
  context: Context,
8
  it: IterableIterator<Value>,
9
  scheduler: Scheduler
10
): void => {
11
  context.debugger.state.it = it
2,293✔
12
  context.debugger.state.scheduler = scheduler
2,293✔
13
}
14

15
export const setBreakpointAtLine = (lines: string[]): void => {
66✔
16
  breakpoints = lines
×
17
}
18

19
export const manualToggleDebugger = (context: Context): Result => {
66✔
20
  context.runtime.break = true
×
21
  return {
×
22
    status: 'suspended',
23
    scheduler: context.debugger.state.scheduler,
24
    it: context.debugger.state.it,
25
    context
26
  }
27
}
28

29
let breakpoints: string[] = []
66✔
30
let moved: boolean = true
66✔
31
let prevStoppedLine: number = -1
66✔
32

33
export const checkEditorBreakpoints = (context: Context, node: Node): void => {
66✔
34
  if (node.loc) {
2,413,813✔
35
    const currentLine = node.loc.start.line - 1
2,293,912✔
36
    if (!moved && currentLine !== prevStoppedLine) {
2,293,912!
37
      moved = true
×
38
    }
39
    if (context.runtime.debuggerOn && breakpoints[currentLine] !== undefined && moved) {
2,293,912!
40
      moved = false
×
41
      prevStoppedLine = currentLine
×
42
      context.runtime.break = true
×
43
    }
44
  }
45
}
46

47
export const areBreakpointsSet = () => breakpoints.length > 0
66✔
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