blit

command
v0.2.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Coverage overlay for btest.

G1: runCoverage runs "go test -coverprofile=.blit/coverage.out ./..." and

parses the resulting coverage profile.

G2: renderCoveragePanel prints a summary to the terminal: total %, top 5

least-covered files, and a mini histogram of per-file coverage buckets.

G3: readCoverage reads the most recent .blit/coverage.out without re-running

tests and renders the same panel.

G4: Both render paths dogfood the charts subpackage (Bar histogram + Gauge).

Command blit is a thin wrapper around `go test` for blit-powered test suites. It adds flags that map to blit features: -update to regenerate snapshots, -junit/-html to emit reports, -filter to pick specific tests, -parallel to set parallelism, and -watch to re-run on file changes.

Subcommands:

blit diff <testname>   show the failure diff for a named test
blit review [root]     interactive review of pending .golden.new snapshots

Usage:

blit [flags] [packages...]
blit record <name> -- <command> [args...]
blit replay [--speed 1x] <name>
blit review [root]

Packages default to "./..." when none are provided. The default reporter is the vitest-style runner already wired into the test code.

Examples:

blit                                   # go test ./...
blit -filter TestHarness ./btest/... # run tests matching TestHarness
blit -update ./btest/...             # regenerate snapshots
blit -junit out/junit.xml -parallel 4  # parallel run + junit output
blit -watch                            # re-run on file changes (1s poll)
blit diff TestFoo                      # show diff for TestFoo failure
blit record dashboard -- ./bin/dashboard
blit replay dashboard --speed 2x

review.go implements `blit review` — an interactive TUI that presents a queue of pending .golden.new snapshot diffs so the developer can accept or reject each one without leaving the terminal.

Key bindings:

a  accept current item (rename .golden.new → .golden atomically)
r  reject current item (delete .golden.new)
s  skip current item (move to next without changing disk)
n  next item
p  prev item
q  quit

Package main — watch.go implements the interactive watch menu for btest.

Running `blit -watch` drops into a bubbletea-powered UI with:

  • A status bar showing active filters and run state
  • A filter panel showing the current p/t/l settings
  • A LogViewer streaming test output in real time

Key bindings (Vitest-style):

p  prompt for path filter
t  prompt for test-name regex
u  toggle snapshot update
f  rerun only failed tests
a  rerun all tests
l  cycle log level: quiet → normal → verbose
c  clear filters (and log)
q  quit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL