Skip to content

CLI

Terminal window
unrift [pattern] [options]

The first positional argument is a regex pattern to filter test files by path.

FlagDescription
-c, --config <path>Path to config file
-b, --bailStop on first test failure
-t, --timeout <ms>Default test timeout in milliseconds
-w, --watchRe-run tests automatically when files change
-d, --debugEnable debug logging
-l, --listList discovered test files without running them
-j, --jsonOutput results as JSON
--cache-clean, --clear-cacheClear the esbuild transform cache
-v, --versionShow version
-h, --helpShow help
Terminal window
# Run all tests
unrift
# Run tests matching a pattern
unrift math
# Stop on first failure with a 10s timeout
unrift --bail --timeout 10000
# Watch mode — re-run on file changes
unrift --watch
# Use a specific config file
unrift --config ./test/custom.config.ts
# List test files without running them
unrift --list
# JSON output for CI pipelines
unrift --json

The --json flag outputs a structured report to stdout:

{
"ok": true,
"passed": 5,
"failed": 0,
"skipped": 1,
"todo": 0,
"total": 6,
"bail": false,
"timeoutMs": 5000,
"testDir": "test",
"configPath": "/path/to/unrift.config.ts",
"durationMs": 142.5,
"files": ["test/math.spec.ts"],
"results": [
{
"description": "math > adds numbers",
"status": "pass",
"durationMs": 1.2
}
]
}

When --json is active, debug output goes to stderr to keep stdout clean.

CodeMeaning
0All tests passed
1One or more tests failed, or no test files found

Unrift caches esbuild bundles in node_modules/.unrift/cache to speed up subsequent runs.

Terminal window
# Clear the cache
unrift --cache-clean