headlamp 0.1.6 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@ Coverage-first, runner-agnostic test UX for Jest/Vitest. Delegates execution to
5
5
  ## Install
6
6
 
7
7
  Only in /Users/david/src/headlamp/src/lib: PLACEHOLDER
8
- Only in /Users/david/src/headlamp/src/lib: _exec.ts
8
+ Only in /Users/david/src/headlamp/src/lib: \_exec.ts
9
9
  Files /Users/david/src/gigworx-node/scripts/cli/coverage-print.ts and /Users/david/src/headlamp/src/lib/coverage-print.ts differ
10
10
  Files /Users/david/src/gigworx-node/scripts/cli/discovery.ts and /Users/david/src/headlamp/src/lib/discovery.ts differ
11
11
  Only in /Users/david/src/headlamp/src/lib: env-utils.ts
@@ -31,6 +31,7 @@ removed
31
31
 
32
32
  Alpha. API/CLI flags may change.
33
33
  und hotspots
34
+
34
35
  - `--coverage.mode=compact|full|auto`: compact table vs full per-file details
35
36
  - `--coverage.maxFiles`, `--coverage.maxHotspots`: limit rows to fit your terminal
36
37
  - `--coverage.pageFit=true|false`: adapt output to terminal rows
@@ -51,6 +52,50 @@ npx headlamp --coverage
51
52
  npx headlamp --coverage src/services/user.ts src/components/UserCard.tsx
52
53
  ```
53
54
 
55
+ ## Output flags
56
+
57
+ - `--onlyFailures[=true|false]`:
58
+ - When enabled, the CLI prints only failing tests during execution across all views, while still printing the final test summary (files/tests/time) at the end.
59
+ - Supported forms: `--onlyFailures`, `--onlyFailures=true`, `--onlyFailures=false`.
60
+ - Works with other selection flags (e.g., `-t`, `--changed`).
61
+
62
+ Examples:
63
+
64
+ ```bash
65
+ # Show only failures during the run, but still print the final summary
66
+ npx headlamp --onlyFailures
67
+
68
+ # Combine with changed-file selection
69
+ npx headlamp --changed --onlyFailures
70
+ ```
71
+
72
+ ## Coverage flags
73
+
74
+ - `--coverage`: enables coverage collection and prints merged coverage output after test execution. Uses your project's Jest/Vitest setup and reads coverage JSON from Jest.
75
+ - Prints a compact per-file table with hotspots and optionally detailed per-file breakdowns.
76
+ - Honors file selection and include/exclude globs when rendering coverage tables.
77
+ - `--coverage.abortOnFailure`: if tests fail, exit immediately with the test exit code and skip coverage printing. Useful in CI when failures should short-circuit.
78
+ - `--coverage.ui=jest|both`:
79
+ - `jest`: write Istanbul text report to `coverage/merged/coverage.txt` only.
80
+ - `both` (default): write both `coverage.txt` and `coverage-summary.txt`.
81
+ - Display and filtering options:
82
+ - `--coverage.mode=compact|full|auto` (default: `auto`): choose compact table-only or full per-file details.
83
+ - `--coverage.detail=<n>|all|auto` (default: `auto`): number of uncovered lines per file to show; `all` shows everything.
84
+ - `--coverage.showCode=true|false` (default: `true` when TTY): show code snippets for uncovered lines in full mode.
85
+ - `--coverage.maxFiles=<n>`: limit number of files in printed tables.
86
+ - `--coverage.maxHotspots=<n>`: limit hotspots per file in compact mode.
87
+ - `--coverage.pageFit=true|false` (default: `true` when TTY): fit output to terminal rows.
88
+
89
+ Examples:
90
+
91
+ ```bash
92
+ # Abort on failing tests without printing coverage
93
+ npx headlamp --coverage --coverage.abortOnFailure
94
+
95
+ # Show compact coverage limited to 50 files and 5 hotspots per file
96
+ npx headlamp --coverage --coverage.mode=compact --coverage.maxFiles=50 --coverage.maxHotspots=5
97
+ ```
98
+
54
99
  ## Editor links
55
100
 
56
101
  Headlamp prints clickable links (OSC 8) to open files at hotspots. Set `--coverage.editor` to override the default editor URL template if needed.
@@ -60,7 +105,7 @@ Headlamp prints clickable links (OSC 8) to open files at hotspots. Set `--covera
60
105
  You can import pieces programmatically:
61
106
 
62
107
  ```ts
63
- import { printCompactCoverage, resolveImportWithRoot } from "headlamp";
108
+ import { printCompactCoverage, resolveImportWithRoot } from 'headlamp';
64
109
  ```
65
110
 
66
111
  ## Status