1.6 KiB
1.6 KiB
shout
Transcript-based shell integration test runner. Bun + TypeScript.
Commands
bun test— run unit testsbunx tsc --noEmit— type checkbun run src/cli/index.ts [files...]— run shout CLI (--port-from <n>auto-assigns$PORT)
Architecture
src/parse.ts— parses.shoutfiles intoShoutFile(list ofCommand)src/run.ts— executes commands viaBun.spawn(["/bin/sh"]), captures output with sentinelssrc/match.ts— wildcard-aware output matching and diff generationsrc/format.ts— evaluates pass/fail, formats failures and summarysrc/update.ts— rewrites.shoutfiles with actual output (--updatemode)src/duration.ts— parses duration strings (10s,500ms,1m)src/cli/index.ts— CLI entry point viacommandersrc/index.ts— barrel exports
.shout file format
$prefix = command to execute- Lines between commands = expected output (stdout+stderr merged)
...on its own line = multi-line wildcard (matches zero or more lines)...inline = matches any characters on that line[N]on last line of expected output = assert exit code N[*]= assert any non-zero exit code; default expects 0#after a command = comment (stripped);#in expected output is literal@env KEY=VALUEbefore first command = set environment variable@setup path.shoutbefore first command = prepend commands (and@env) from another file- Each file runs in a fresh temp dir with a single
/bin/shsession
Style
- Strict TypeScript, Bun runtime
- No classes — plain functions and types
- Tests in
src/*.test.ts, example.shoutfiles intest/