headlamp 0.1.9 → 0.1.11

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
@@ -69,11 +69,43 @@ npx headlamp --onlyFailures
69
69
  npx headlamp --changed --onlyFailures
70
70
  ```
71
71
 
72
+ ## Changed-file selection
73
+
74
+ - `--changed[=mode]` selects tests by files changed in your working tree or branch.
75
+ - Modes:
76
+ - `all` (default when `--changed` is passed without a value): includes staged + unstaged + untracked files.
77
+ - `staged`: only staged changes.
78
+ - `unstaged`: only unstaged + untracked files.
79
+ - `branch`: union of
80
+ - files changed on the current branch relative to the default branch (via merge-base), and
81
+ - your current uncommitted changes (staged, unstaged tracked, and untracked files).
82
+ - Default branch is resolved via `origin/HEAD` when available, falling back to `origin/main` or `origin/master`.
83
+ - Effects:
84
+ - Uses changed production files as seeds to discover related tests by import-graph.
85
+ - Coverage tables prioritize and annotate files related to selection/changed files.
86
+
87
+ Examples:
88
+
89
+ ```bash
90
+ # Staged changes only
91
+ npx headlamp --changed=staged
92
+
93
+ # All working tree changes
94
+ npx headlamp --changed
95
+
96
+ # Diff current branch against default branch (merge-base)
97
+ npx headlamp --changed=branch
98
+
99
+ # Combine with coverage
100
+ npx headlamp --coverage --changed=branch
101
+ ```
102
+
72
103
  ## Coverage flags
73
104
 
74
105
  - `--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
106
  - Prints a compact per-file table with hotspots and optionally detailed per-file breakdowns.
76
107
  - Honors file selection and include/exclude globs when rendering coverage tables.
108
+ - When `--changed` is specified, coverage views factor in those changed files as selection seeds, influencing relevancy ordering and the “changed-related” highlighting.
77
109
  - `--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
110
  - `--coverage.ui=jest|both`:
79
111
  - `jest`: write Istanbul text report to `coverage/merged/coverage.txt` only.