CLI
unrift [pattern] [options]The first positional argument is a regex pattern to filter test files by path.
| Flag | Description |
|---|---|
-c, --config <path> | Path to config file |
-b, --bail | Stop on first test failure |
-t, --timeout <ms> | Default test timeout in milliseconds |
-w, --watch | Re-run tests automatically when files change |
-d, --debug | Enable debug logging |
-l, --list | List discovered test files without running them |
-j, --json | Output results as JSON |
--cache-clean, --clear-cache | Clear the esbuild transform cache |
-v, --version | Show version |
-h, --help | Show help |
Examples
Section titled “Examples”# Run all testsunrift
# Run tests matching a patternunrift math
# Stop on first failure with a 10s timeoutunrift --bail --timeout 10000
# Watch mode — re-run on file changesunrift --watch
# Use a specific config fileunrift --config ./test/custom.config.ts
# List test files without running themunrift --list
# JSON output for CI pipelinesunrift --jsonJSON output
Section titled “JSON output”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.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | All tests passed |
1 | One or more tests failed, or no test files found |
Cache management
Section titled “Cache management”Unrift caches esbuild bundles in node_modules/.unrift/cache to speed up subsequent runs.
# Clear the cacheunrift --cache-clean