Functions

f
moduleNameFor(file: string): string

The name a file goes into scope under when nobody says what to call it.

f
namespacesFor(found: readonly string[]): Map<string, string>

What each preload goes into scope as, with two that want one name pulled apart rather than left to overwrite each other.

f
preferredFirst(
found: readonly string[],
asked: readonly string[],
cwd: string
): string[]

The preload list with, in each group of files that want one name, the one that should keep it moved to the front.

f
resolvePreload(
config: Config,
inputs: readonly string[]
): Promise<string[]>

The files a qunitx repl <inputs> invocation should preload, resolved the way a run resolves its targets — directories walked, globs expanded, extensions honoured.

f
start(
config: Config,
preload?: string[],
onOpen?: (session: ReplSession) => void
): Promise<ReplSession>

Starts a REPL for an assembled config: bundles qunitx and the preload files, serves it, opens a page on it, and attaches to that page over CDP.

Interfaces

I
Breakpoint

A breakpoint the session set, numbered the way gdb numbers them.

I
Frame

One frame of a stopped call stack.

  • index: number

    Its place on the stack: 0 is where the page stopped, and each one after it is the caller.

  • selected: boolean

    Whether the rest of the session is currently reading this one.

  • where: string

    Where it is, the same way a pause names itself.

I
ReplResult

What one input produced. output is already rendered — the terminal prints it verbatim — and the rest is there so a caller can react rather than parse.

  • failed: boolean

    Whether the input worked. What output never says, and what a caller needs before it can do anything but print: colour the line red, decline to add it to the replayable history, exit non-zero on a piped session.

  • incomplete: boolean

    The input was unfinished (const a = {), so nothing ran and the terminal should read on.

  • output: string

    The text to print, whichever way it went: the rendered value when the input worked, the error and its source-mapped stack when it did not. Empty when there is nothing to print.

  • pausedAt: string

    Where the input stopped at a debugger statement, or absent when it ran to completion.

  • tests: TestDetails[]

    Tests QUnit ran because of this input. Already reported through the session's reporters.

  • thrown: boolean

    The failure was the page throwing, rather than the session refusing the input.

I
ReplSession

A live REPL: one browser page, kept open, that evaluates what you type.

I
ScopeEntry

One thing in scope: what it is called, what it holds, and where it came from.

Type Aliases

T
ReplStartFailure =
Failure.Of<UnsupportedBrowser>
| Failure.Of<PreloadBuildFailed>

Everything starting a REPL can fail with, beyond config assembly.

T
StepKind = "into" | "over" | "out"

One step, named the way gdb names it: step, next, finish.

Variables

v
UnsupportedBrowser: Failure.FailureFactory<"UnsupportedBrowser", { browser: string; }>

The REPL evaluates over the Chrome DevTools Protocol, which firefox and webkit do not speak.