| Crates.io | headlamp |
| lib.rs | headlamp |
| version | 0.1.60 |
| created_at | 2025-12-26 16:25:52.312793+00 |
| updated_at | 2026-01-03 17:16:00.941108+00 |
| description | Dependency-graph based test runner in Rust that supports Rust, Python, and JavaScript. |
| homepage | https://github.com/dbpiper/headlamp |
| repository | https://github.com/dbpiper/headlamp |
| max_upload_size | |
| id | 2005912 |
| size | 951,467 |
Headlamp is a Rust-powered test UX CLI: smarter test selection, cleaner output, and a unified workflow across jest, Rust tests (headlamp runner), cargo test, cargo nextest and pytest.
Headlamp is useful when you want a consistent way to run tests across different projects and keep feedback fast as your repo grows. It can select tests based on what changed, surface failures in a readable format, and keep common defaults (like runner args and coverage settings) in a single config file so your team doesn’t have to remember a long list of flags.
--runner=headlamp|jest|cargo-nextest|cargo-test|pytest--changed) and what’s related (dependency-graph driven)Requirements:
Install:
npm i -D headlamp
Run:
npx headlamp --help
Install from crates.io:
cargo install headlamp
npx headlamp --runner=jest
Forward runner args after -- (unknown args are forwarded):
npx headlamp --runner=jest -- --runInBand
headlamp --runner=cargo-nextest
headlamp --runner=cargo-test
Requirements:
--runner=cargo-nextest: requires cargo-nextest to be installed.
cargo install cargo-nextest (or your preferred installer)Runs Rust test binaries directly (built via cargo test --no-run), parses libtest output, and renders Headlamp’s unified test UI.
headlamp --runner=headlamp
Rust coverage (--coverage) is collected via LLVM tools from rustup (no cargo-llvm-cov dependency).
rustup component add llvm-tools-preview
rustup toolchain install nightly
rustup component add llvm-tools-preview --toolchain nightly
Per-test timings in the native Rust runner (--runner=headlamp) require a preinstalled nightly toolchain.
Headlamp enables libtest JSON output + --report-time only when nightly is available (it will not auto-download nightly at runtime).
rustup toolchain install nightly
Run headlamp --help to see the up-to-date flags list.
Highlights:
--runner=headlamp|jest|pytest|cargo-nextest|cargo-test--changed=all|staged|unstaged|branch|lastCommit|lastRelease
lastRelease selects changes since the previous stable SemVer release tag--coverage plus --coverage-ui, --coverage.detail, thresholds, etc.Headlamp discovers config from your repo root. Supported file names:
headlamp.config.tsheadlamp.config.jsheadlamp.config.mjsheadlamp.config.cjsheadlamp.config.jsonheadlamp.config.json5headlamp.config.jsoncheadlamp.config.yamlheadlamp.config.yml.headlamprc plus .headlamprc.* variants (.json, .json5, .jsonc, .yaml, .yml, .js, .cjs, .mjs, .ts)headlamp.config.tsRules:
./ and ../)export default {
// Runner defaults
jestArgs: ["--runInBand"],
// Run once before tests (npm script name or a shell command)
bootstrapCommand: "test:jest:bootstrap",
// Global toggles
ci: false,
verbose: false,
noCache: false,
// Coverage defaults
coverage: true,
coverageUi: "both",
coverage: {
abortOnFailure: true,
mode: "auto",
pageFit: true,
},
// Changed selection defaults
changed: { depth: 2 },
};
Pull requests are welcome. For large changes, open an issue first to align on direction.
MIT — see LICENSE.