headlamp 0.1.18 → 0.1.20
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 +83 -215
- package/dist/cli.cjs +29 -3
- package/dist/cli.cjs.map +2 -2
- package/dist/index.js +29 -3
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,54 +1,78 @@
|
|
|
1
1
|
# Headlamp CLI
|
|
2
2
|
|
|
3
|
-
Coverage-first, runner-agnostic test UX for Jest
|
|
3
|
+
Coverage-first, runner-agnostic test UX for Jest. Delegates execution to your runner, focuses on better selection and coverage insights.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
Only in /Users/david/src/headlamp/src/lib: \_exec.ts
|
|
9
|
-
Files /Users/david/src/gigworx-node/scripts/cli/coverage-print.ts and /Users/david/src/headlamp/src/lib/coverage-print.ts differ
|
|
10
|
-
Files /Users/david/src/gigworx-node/scripts/cli/discovery.ts and /Users/david/src/headlamp/src/lib/discovery.ts differ
|
|
11
|
-
Only in /Users/david/src/headlamp/src/lib: env-utils.ts
|
|
12
|
-
Only in /Users/david/src/headlamp/src/lib: fast-related.ts
|
|
13
|
-
Files /Users/david/src/gigworx-node/scripts/cli/graph-distance.ts and /Users/david/src/headlamp/src/lib/graph-distance.ts differ
|
|
14
|
-
Files /Users/david/src/gigworx-node/scripts/cli/index.ts and /Users/david/src/headlamp/src/lib/index.ts differ
|
|
15
|
-
Files /Users/david/src/gigworx-node/scripts/cli/program.ts and /Users/david/src/headlamp/src/lib/program.ts differ
|
|
7
|
+
Use via npx (recommended):
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npx headlamp --help
|
|
11
|
+
```
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
Or install locally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i -D headlamp
|
|
17
|
+
```
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
- Delegates to your local Jest install
|
|
23
22
|
- Renders improved coverage tables and hotspots
|
|
24
23
|
- Selects tests by import-graph when you pass production paths
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Quick examples:
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
```bash
|
|
28
|
+
# Run tests with coverage
|
|
29
|
+
npx headlamp --coverage
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
# Run only tests related to selected production files
|
|
32
|
+
npx headlamp src/services/user.ts src/components/UserCard.tsx
|
|
33
|
+
```
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
und hotspots
|
|
35
|
+
## CLI flags
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
- `--coverage.maxFiles`, `--coverage.maxHotspots`: limit rows to fit your terminal
|
|
37
|
-
- `--coverage.pageFit=true|false`: adapt output to terminal rows
|
|
37
|
+
Pass your regular Jest flags (e.g. `-t`, `--testNamePattern`, paths). Headlamp forwards them, and strips/adjusts coverage-related flags when listing tests.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
### General
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
- `--bootstrapCommand <cmd>`: run once before tests (npm script name or full shell command)
|
|
42
|
+
- `--onlyFailures[=true|false]`: show only failing tests during live output; always shows final summary
|
|
43
|
+
- `--showLogs[=true|false]`: include full console output under failing tests/files
|
|
44
|
+
|
|
45
|
+
### Concurrency
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
- `--sequential[=true|false]`: serialize execution
|
|
48
|
+
- Effect: adds Jest `--runInBand` and runs Headlamp’s per‑project execution with stride 1 (no parallel projects)
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
- Coverage-context defaults: only applied if coverage is active (i.e., you passed `--coverage` or you set `coverage: true` in config)
|
|
47
|
-
- Changed-context defaults: only applied if changed selection is active (i.e., you passed `--changed=…` or set a default mode in config)
|
|
50
|
+
### Selection
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
- `paths...`: any file/dir paths; production paths trigger related test discovery by import graph
|
|
53
|
+
- `-t <pattern>` / `--testNamePattern <pattern>`: filter by test name
|
|
54
|
+
- `--changed[=all|staged|unstaged|branch|lastCommit]`: select tests related to changed files
|
|
55
|
+
- `--changed.depth=<n>`: cap transitive import scan depth for changed-file discovery (default: 5)
|
|
50
56
|
|
|
51
|
-
###
|
|
57
|
+
### Coverage
|
|
58
|
+
|
|
59
|
+
- `--coverage`: enable coverage collection and merged reporting
|
|
60
|
+
- `--coverage.ui=jest|both` (alias: `--coverage-ui`): output mode for Istanbul text reports (default: `both`)
|
|
61
|
+
- `--coverage.abortOnFailure`: exit immediately with test code and skip coverage print on failures
|
|
62
|
+
- Display/detail options:
|
|
63
|
+
- `--coverage.mode=compact|full|auto` (default: `auto`)
|
|
64
|
+
- `--coverage.detail=<n>|all|auto` (default: `auto`)
|
|
65
|
+
- `--coverage.showCode=true|false` (default: `true` on TTY)
|
|
66
|
+
- `--coverage.maxFiles=<n>`
|
|
67
|
+
- `--coverage.maxHotspots=<n>`
|
|
68
|
+
- `--coverage.pageFit=true|false` (default: `true` on TTY)
|
|
69
|
+
- Globbing filters: `--coverage.include=a,b,c`, `--coverage.exclude=a,b,c`
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
Project-level file at repo root. CLI always overrides config. No env vars or hidden presets.
|
|
74
|
+
|
|
75
|
+
### Supported filenames
|
|
52
76
|
|
|
53
77
|
- `headlamp.config.ts`
|
|
54
78
|
- `headlamp.config.js` / `headlamp.config.mjs` / `headlamp.config.cjs`
|
|
@@ -56,24 +80,13 @@ CLI always overrides config. No environment variables or hidden presets are used
|
|
|
56
80
|
|
|
57
81
|
### Base defaults (always applied)
|
|
58
82
|
|
|
59
|
-
|
|
83
|
+
- `bootstrapCommand: string`
|
|
84
|
+
- `jestArgs: string[]`
|
|
85
|
+
- `sequential?: boolean` – serialize tests across Jest and Headlamp
|
|
60
86
|
|
|
61
|
-
-
|
|
62
|
-
- `jestArgs: string[]` – extra args passed to Jest (e.g., `['--runInBand']`)
|
|
87
|
+
### Coverage-context defaults (applied only when coverage is active)
|
|
63
88
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
// headlamp.config.ts
|
|
68
|
-
export default {
|
|
69
|
-
bootstrapCommand: 'test:jest:bootstrap',
|
|
70
|
-
jestArgs: ['--runInBand'],
|
|
71
|
-
};
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Coverage-context defaults
|
|
75
|
-
|
|
76
|
-
Applied only when coverage is active (triggered by `--coverage` on the CLI or `coverage: true` in config). Prefer the nested `coverage` section:
|
|
89
|
+
Prefer the nested `coverage` section:
|
|
77
90
|
|
|
78
91
|
```ts
|
|
79
92
|
export default {
|
|
@@ -85,59 +98,37 @@ export default {
|
|
|
85
98
|
};
|
|
86
99
|
```
|
|
87
100
|
|
|
88
|
-
|
|
101
|
+
Additional recognized fields when coverage is active:
|
|
89
102
|
|
|
90
103
|
- `editorCmd` -> `--coverage.editor`
|
|
91
|
-
- `include
|
|
92
|
-
- `
|
|
93
|
-
- `coverageDetail: number | 'all' | 'auto'` -> `--coverage.detail`
|
|
94
|
-
- `coverageShowCode: boolean` -> `--coverage.showCode`
|
|
95
|
-
- `coverageMaxFiles: number` -> `--coverage.maxFiles`
|
|
96
|
-
- `coverageMaxHotspots: number` -> `--coverage.maxHotspots`
|
|
104
|
+
- `include`, `exclude` -> `--coverage.include`, `--coverage.exclude`
|
|
105
|
+
- `coverageDetail`, `coverageShowCode`, `coverageMaxFiles`, `coverageMaxHotspots`
|
|
97
106
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### Changed-context defaults
|
|
101
|
-
|
|
102
|
-
Applied only when changed selection is active (triggered by `--changed=…` on the CLI, or by specifying a default mode in config). Prefer the nested `changed` section:
|
|
107
|
+
### Changed-context defaults (applied only when changed selection is active)
|
|
103
108
|
|
|
104
109
|
```ts
|
|
105
110
|
export default {
|
|
106
111
|
changed: {
|
|
107
|
-
depth: 20, // default
|
|
108
|
-
branch: {
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
depth: 8,
|
|
113
|
-
},
|
|
114
|
-
unstaged: {
|
|
115
|
-
depth: 6,
|
|
116
|
-
},
|
|
117
|
-
all: {
|
|
118
|
-
depth: 12,
|
|
119
|
-
},
|
|
112
|
+
depth: 20, // default for all modes -> --changed.depth=20
|
|
113
|
+
branch: { depth: 10 },
|
|
114
|
+
staged: { depth: 8 },
|
|
115
|
+
unstaged: { depth: 6 },
|
|
116
|
+
all: { depth: 12 },
|
|
120
117
|
},
|
|
121
118
|
};
|
|
122
119
|
```
|
|
123
120
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### Precedence and gating rules
|
|
127
|
-
|
|
128
|
-
- CLI always wins. If you pass `--coverage.mode=full`, it overrides the config’s `coverage.mode`.
|
|
129
|
-
- Coverage extras only apply when coverage is active.
|
|
130
|
-
- Changed depth only applies when changed selection is active. If a per‑mode depth exists, it’s used; otherwise we fall back to the default `changed.depth`.
|
|
121
|
+
You may also set a top‑level default mode (e.g., `changed: 'branch'`); CLI still wins.
|
|
131
122
|
|
|
132
|
-
###
|
|
133
|
-
|
|
134
|
-
Config (headlamp.config.ts):
|
|
123
|
+
### Full example
|
|
135
124
|
|
|
136
125
|
```ts
|
|
126
|
+
// headlamp.config.ts
|
|
137
127
|
export default {
|
|
138
128
|
// Base
|
|
139
129
|
bootstrapCommand: 'test:jest:bootstrap',
|
|
140
|
-
|
|
130
|
+
sequential: true, // serialize tests (maps to Jest --runInBand and single-project stride)
|
|
131
|
+
jestArgs: ['--runInBand'], // optional: redundant when sequential is true
|
|
141
132
|
|
|
142
133
|
// Coverage-context
|
|
143
134
|
coverage: {
|
|
@@ -154,159 +145,33 @@ export default {
|
|
|
154
145
|
};
|
|
155
146
|
```
|
|
156
147
|
|
|
157
|
-
Scripts
|
|
148
|
+
## Scripts
|
|
158
149
|
|
|
159
150
|
```json
|
|
160
151
|
{
|
|
161
152
|
"scripts": {
|
|
162
|
-
"test": "headlamp --
|
|
163
|
-
"test:coverage": "headlamp --coverage --
|
|
153
|
+
"test": "headlamp --sequential",
|
|
154
|
+
"test:coverage": "headlamp --coverage --sequential",
|
|
164
155
|
"test:dev": "npm run test -- --changed=branch --coverage --onlyFailures"
|
|
165
156
|
}
|
|
166
157
|
}
|
|
167
158
|
```
|
|
168
159
|
|
|
169
|
-
Resulting behavior:
|
|
170
|
-
|
|
171
|
-
- `headlamp --runInBand`: base defaults only; no coverage/changed extras.
|
|
172
|
-
- `headlamp --coverage --runInBand`: applies coverage abortOnFailure/mode/pageFit; changed depth is not applied.
|
|
173
|
-
- `headlamp --changed=branch --coverage --onlyFailures`: applies per‑mode changed depth (10) and coverage group; `onlyFailures` is opt‑in via CLI.
|
|
174
|
-
|
|
175
|
-
## Examples
|
|
176
|
-
|
|
177
|
-
- Show coverage with detailed hotspots, auto-fit to terminal rows:
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
npx headlamp --coverage
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
- Focus on specific production files and run only directly-related tests:
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
npx headlamp --coverage src/services/user.ts src/components/UserCard.tsx
|
|
187
|
-
```
|
|
188
|
-
|
|
189
160
|
## Bootstrap command
|
|
190
161
|
|
|
191
162
|
Use `--bootstrapCommand` to run setup work before tests (e.g., database migrations/seeding). If omitted, no bootstrap runs.
|
|
192
163
|
|
|
193
|
-
- Single token
|
|
194
|
-
-
|
|
164
|
+
- Single token: treated as an npm script name and run as `npm run -s <name>`
|
|
165
|
+
- With spaces: treated as a full command and executed via the system shell
|
|
195
166
|
|
|
196
167
|
Examples:
|
|
197
168
|
|
|
198
169
|
```bash
|
|
199
|
-
# 1) Run an npm script before tests
|
|
200
170
|
npx headlamp --bootstrapCommand test:jest:bootstrap
|
|
201
|
-
|
|
202
|
-
# 2) Run an npm script with its own args
|
|
203
|
-
npx headlamp --bootstrapCommand "db:migrate -- --reset"
|
|
204
|
-
|
|
205
|
-
# 3) Run an arbitrary command (e.g., sequelize migrations for test env)
|
|
206
171
|
npx headlamp --bootstrapCommand "sequelize db:migrate --env test"
|
|
207
|
-
|
|
208
|
-
# 4) Seed a test database via a node script
|
|
209
|
-
npx headlamp --bootstrapCommand "node scripts/seed-test-db.js"
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
This bootstrap step executes once before Jest is started. If the bootstrap exits non‑zero, the run aborts with an error.
|
|
213
|
-
|
|
214
|
-
## Output flags
|
|
215
|
-
|
|
216
|
-
- `--onlyFailures[=true|false]`:
|
|
217
|
-
- 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.
|
|
218
|
-
- Supported forms: `--onlyFailures`, `--onlyFailures=true`, `--onlyFailures=false`.
|
|
219
|
-
- Works with other selection flags (e.g., `-t`, `--changed`).
|
|
220
|
-
|
|
221
|
-
Examples:
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
# Show only failures during the run, but still print the final summary
|
|
225
|
-
npx headlamp --onlyFailures
|
|
226
|
-
|
|
227
|
-
# Combine with changed-file selection
|
|
228
|
-
npx headlamp --changed --onlyFailures
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
- `--showLogs[=true|false]`:
|
|
232
|
-
- When enabled, Headlamp prints a dedicated "Logs" section under each failing test and failing file with the full console output captured by the runner.
|
|
233
|
-
- By default (without this flag), Headlamp shows a condensed "Console errors" snippet with only the most relevant error messages. `--showLogs` includes all console entries (log/info/warn/error).
|
|
234
|
-
- Supported forms: `--showLogs`, `--showLogs=true`, `--showLogs=false`.
|
|
235
|
-
- Works alongside `--onlyFailures`, coverage flags, and selection flags.
|
|
236
|
-
|
|
237
|
-
Examples:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
# Always include the full console output for each failure
|
|
241
|
-
npx headlamp --showLogs
|
|
242
|
-
|
|
243
|
-
# Combine with only failures visible during the run
|
|
244
|
-
npx headlamp --onlyFailures --showLogs
|
|
245
172
|
```
|
|
246
173
|
|
|
247
|
-
##
|
|
248
|
-
|
|
249
|
-
- `--changed[=mode]` selects tests by files changed in your working tree or branch.
|
|
250
|
-
- Modes:
|
|
251
|
-
- `all` (default when `--changed` is passed without a value): includes staged + unstaged + untracked files.
|
|
252
|
-
- `staged`: only staged changes.
|
|
253
|
-
- `unstaged`: only unstaged + untracked files.
|
|
254
|
-
- `branch`: union of
|
|
255
|
-
- files changed on the current branch relative to the default branch (via merge-base), and
|
|
256
|
-
- your current uncommitted changes (staged, unstaged tracked, and untracked files).
|
|
257
|
-
- Default branch is resolved via `origin/HEAD` when available, falling back to `origin/main` or `origin/master`.
|
|
258
|
-
- `lastCommit`: files changed in the last commit (`git diff --name-only HEAD^ HEAD`). Useful on main to scope to the most recent change.
|
|
259
|
-
- Effects:
|
|
260
|
-
- Uses changed production files as seeds to discover related tests by import-graph.
|
|
261
|
-
- Coverage tables prioritize and annotate files related to selection/changed files.
|
|
262
|
-
- Additional flags:
|
|
263
|
-
- `--changed.depth=<n>`: cap the transitive import scan depth when refining related tests from changed production files. Default: 5. Increase to include more indirectly-related tests (slower), decrease for speed.
|
|
264
|
-
|
|
265
|
-
Examples:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
# Staged changes only
|
|
269
|
-
npx headlamp --changed=staged
|
|
270
|
-
|
|
271
|
-
# All working tree changes
|
|
272
|
-
npx headlamp --changed
|
|
273
|
-
|
|
274
|
-
# Diff current branch against default branch (merge-base)
|
|
275
|
-
npx headlamp --changed=branch
|
|
276
|
-
|
|
277
|
-
# Combine with coverage
|
|
278
|
-
npx headlamp --coverage --changed=branch
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
Depth examples:
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
# Scan imports up to 10 levels deep when resolving related tests for changed files
|
|
285
|
-
npx headlamp --changed=all --changed.depth=10
|
|
286
|
-
|
|
287
|
-
# With branch mode
|
|
288
|
-
npx headlamp --changed=branch --changed.depth=12
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
## Coverage flags
|
|
292
|
-
|
|
293
|
-
- `--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.
|
|
294
|
-
- Prints a compact per-file table with hotspots and optionally detailed per-file breakdowns.
|
|
295
|
-
- Honors file selection and include/exclude globs when rendering coverage tables.
|
|
296
|
-
- When `--changed` is specified, coverage views factor in those changed files as selection seeds, influencing relevancy ordering and the “changed-related” highlighting.
|
|
297
|
-
- `--coverage.abortOnFailure`: if tests fail, exit immediately with the test exit code and skip coverage printing. Useful in CI when failures should short-circuit.
|
|
298
|
-
- `--coverage.ui=jest|both`:
|
|
299
|
-
- `jest`: write Istanbul text report to `coverage/merged/coverage.txt` only.
|
|
300
|
-
- `both` (default): write both `coverage.txt` and `coverage-summary.txt`.
|
|
301
|
-
- Display and filtering options:
|
|
302
|
-
- `--coverage.mode=compact|full|auto` (default: `auto`): choose compact table-only or full per-file details.
|
|
303
|
-
- `--coverage.detail=<n>|all|auto` (default: `auto`): number of uncovered lines per file to show; `all` shows everything.
|
|
304
|
-
- `--coverage.showCode=true|false` (default: `true` when TTY): show code snippets for uncovered lines in full mode.
|
|
305
|
-
- `--coverage.maxFiles=<n>`: limit number of files in printed tables.
|
|
306
|
-
- `--coverage.maxHotspots=<n>`: limit hotspots per file in compact mode.
|
|
307
|
-
- `--coverage.pageFit=true|false` (default: `true` when TTY): fit output to terminal rows.
|
|
308
|
-
|
|
309
|
-
Examples:
|
|
174
|
+
## Examples
|
|
310
175
|
|
|
311
176
|
```bash
|
|
312
177
|
# Abort on failing tests without printing coverage
|
|
@@ -314,6 +179,9 @@ npx headlamp --coverage --coverage.abortOnFailure
|
|
|
314
179
|
|
|
315
180
|
# Show compact coverage limited to 50 files and 5 hotspots per file
|
|
316
181
|
npx headlamp --coverage --coverage.mode=compact --coverage.maxFiles=50 --coverage.maxHotspots=5
|
|
182
|
+
|
|
183
|
+
# Sequential run to avoid DB deadlocks
|
|
184
|
+
npx headlamp --sequential
|
|
317
185
|
```
|
|
318
186
|
|
|
319
187
|
## Editor links
|
|
@@ -322,7 +190,7 @@ Headlamp prints clickable links (OSC 8) to open files at hotspots. Set `--covera
|
|
|
322
190
|
|
|
323
191
|
## API
|
|
324
192
|
|
|
325
|
-
|
|
193
|
+
Programmatic use:
|
|
326
194
|
|
|
327
195
|
```ts
|
|
328
196
|
import { printCompactCoverage, resolveImportWithRoot } from 'headlamp';
|
package/dist/cli.cjs
CHANGED
|
@@ -53569,6 +53569,7 @@ var init_args = __esm({
|
|
|
53569
53569
|
coverageAbortOnFailure: (value2) => ({ type: "coverageAbortOnFailure", value: value2 }),
|
|
53570
53570
|
onlyFailures: (value2) => ({ type: "onlyFailures", value: value2 }),
|
|
53571
53571
|
showLogs: (value2) => ({ type: "showLogs", value: value2 }),
|
|
53572
|
+
sequential: (value2) => ({ type: "sequential", value: value2 }),
|
|
53572
53573
|
bootstrapCommand: (value2) => ({ type: "bootstrapCommand", value: value2 }),
|
|
53573
53574
|
jestArg: (value2) => ({ type: "jestArg", value: value2 }),
|
|
53574
53575
|
jestArgs: (values) => ({ type: "jestArgs", values }),
|
|
@@ -53745,6 +53746,16 @@ var init_args = __esm({
|
|
|
53745
53746
|
"--onlyFailures",
|
|
53746
53747
|
(_flag, lookahead) => step([ActionBuilders.onlyFailures(isTruthy(String(lookahead)))], true)
|
|
53747
53748
|
),
|
|
53749
|
+
// --sequential flag (boolean) → serialize projects and map to jest --runInBand
|
|
53750
|
+
rule.eq("--sequential", () => step([ActionBuilders.sequential(true)])),
|
|
53751
|
+
rule.startsWith(
|
|
53752
|
+
"--sequential=",
|
|
53753
|
+
(value2) => step([ActionBuilders.sequential(isTruthy((value2.split("=")[1] ?? "").trim().toLowerCase()))])
|
|
53754
|
+
),
|
|
53755
|
+
rule.withLookahead(
|
|
53756
|
+
"--sequential",
|
|
53757
|
+
(_flag, lookahead) => step([ActionBuilders.sequential(isTruthy(String(lookahead)))], true)
|
|
53758
|
+
),
|
|
53748
53759
|
// --showLogs flag (boolean)
|
|
53749
53760
|
rule.eq("--showLogs", () => step([ActionBuilders.showLogs(true)])),
|
|
53750
53761
|
rule.startsWith(
|
|
@@ -53915,6 +53926,8 @@ var init_args = __esm({
|
|
|
53915
53926
|
return { vitest: [], jest: [], coverage: false, onlyFailures: action.value };
|
|
53916
53927
|
case "showLogs":
|
|
53917
53928
|
return { vitest: [], jest: [], coverage: false, showLogs: action.value };
|
|
53929
|
+
case "sequential":
|
|
53930
|
+
return { vitest: [], jest: [], coverage: false, sequential: action.value };
|
|
53918
53931
|
case "jestArgs":
|
|
53919
53932
|
return { vitest: [], jest: action.values, coverage: false };
|
|
53920
53933
|
case "selectionHint":
|
|
@@ -53994,6 +54007,7 @@ var init_args = __esm({
|
|
|
53994
54007
|
...right.coverageAbortOnFailure !== void 0 || left.coverageAbortOnFailure !== void 0 ? { coverageAbortOnFailure: right.coverageAbortOnFailure ?? left.coverageAbortOnFailure } : {},
|
|
53995
54008
|
...right.onlyFailures !== void 0 || left.onlyFailures !== void 0 ? { onlyFailures: right.onlyFailures ?? left.onlyFailures } : {},
|
|
53996
54009
|
...right.showLogs !== void 0 || left.showLogs !== void 0 ? { showLogs: right.showLogs ?? left.showLogs } : {},
|
|
54010
|
+
...right.sequential !== void 0 || left.sequential !== void 0 ? { sequential: right.sequential ?? left.sequential } : {},
|
|
53997
54011
|
...right.coverageDetail !== void 0 || left.coverageDetail !== void 0 ? { coverageDetail: right.coverageDetail ?? left.coverageDetail } : {},
|
|
53998
54012
|
...right.coverageShowCode !== void 0 || left.coverageShowCode !== void 0 ? { coverageShowCode: right.coverageShowCode ?? left.coverageShowCode } : {},
|
|
53999
54013
|
...right.coverageMode !== void 0 || left.coverageMode !== void 0 ? { coverageMode: right.coverageMode ?? left.coverageMode } : {},
|
|
@@ -54019,6 +54033,7 @@ var init_args = __esm({
|
|
|
54019
54033
|
let coverageAbortOnFailure = false;
|
|
54020
54034
|
let onlyFailures = false;
|
|
54021
54035
|
let showLogs = false;
|
|
54036
|
+
let sequential = false;
|
|
54022
54037
|
let coverageShowCode = Boolean(process.stdout.isTTY);
|
|
54023
54038
|
let coverageMode = "auto";
|
|
54024
54039
|
const coverageMaxFilesLocalInit = void 0;
|
|
@@ -54052,6 +54067,7 @@ var init_args = __esm({
|
|
|
54052
54067
|
if (conf.onlyFailures !== void 0)
|
|
54053
54068
|
p3.onlyFailures = Boolean(conf.onlyFailures);
|
|
54054
54069
|
if (conf.showLogs !== void 0) p3.showLogs = Boolean(conf.showLogs);
|
|
54070
|
+
if (conf.sequential !== void 0) p3.sequential = Boolean(conf.sequential);
|
|
54055
54071
|
if (conf.editorCmd) p3.editorCmd = String(conf.editorCmd);
|
|
54056
54072
|
if (conf.workspaceRoot) p3.workspaceRoot = String(conf.workspaceRoot);
|
|
54057
54073
|
if (Array.isArray(conf.include)) p3.includeGlobs = conf.include;
|
|
@@ -54090,6 +54106,7 @@ var init_args = __esm({
|
|
|
54090
54106
|
coverageAbortOnFailure = contrib.coverageAbortOnFailure ?? coverageAbortOnFailure;
|
|
54091
54107
|
onlyFailures = contrib.onlyFailures ?? onlyFailures;
|
|
54092
54108
|
showLogs = contrib.showLogs ?? showLogs;
|
|
54109
|
+
sequential = contrib.sequential ?? sequential;
|
|
54093
54110
|
coverageShowCode = contrib.coverageShowCode ?? coverageShowCode;
|
|
54094
54111
|
const { bootstrapCommand } = contrib;
|
|
54095
54112
|
const coverageDetailComputed = contrib.coverageDetail ?? (contrib.selection ? "auto" : void 0);
|
|
@@ -54110,6 +54127,9 @@ var init_args = __esm({
|
|
|
54110
54127
|
if (showLogs) {
|
|
54111
54128
|
jestArgs.push("--no-silent");
|
|
54112
54129
|
}
|
|
54130
|
+
if (sequential && !jestArgs.includes("--runInBand")) {
|
|
54131
|
+
jestArgs.push("--runInBand");
|
|
54132
|
+
}
|
|
54113
54133
|
const selectionLooksLikeTestPath = (contrib.selectionPaths ?? []).some(
|
|
54114
54134
|
(selectionPath) => /\.(test|spec)\.[tj]sx?$/i.test(selectionPath) || /(^|\/)tests?\//i.test(selectionPath)
|
|
54115
54135
|
);
|
|
@@ -54129,6 +54149,7 @@ var init_args = __esm({
|
|
|
54129
54149
|
coverageAbortOnFailure: configFromFile?.coverageAbortOnFailure ?? coverageAbortOnFailure,
|
|
54130
54150
|
onlyFailures: configFromFile?.onlyFailures ?? onlyFailures,
|
|
54131
54151
|
showLogs: configFromFile?.showLogs ?? showLogs,
|
|
54152
|
+
sequential: configFromFile?.sequential ?? sequential,
|
|
54132
54153
|
...bootstrapCommand !== void 0 ? { bootstrapCommand } : {},
|
|
54133
54154
|
selectionSpecified: Boolean(contrib.selection),
|
|
54134
54155
|
selectionPaths: [...contrib.selectionPaths ?? []],
|
|
@@ -60154,6 +60175,9 @@ var program = async () => {
|
|
|
60154
60175
|
if (cfg.bootstrapCommand) {
|
|
60155
60176
|
pushKV("--bootstrapCommand", cfg.bootstrapCommand);
|
|
60156
60177
|
}
|
|
60178
|
+
if (cfg.sequential === true) {
|
|
60179
|
+
t2.push("--sequential");
|
|
60180
|
+
}
|
|
60157
60181
|
if (Array.isArray(cfg.jestArgs) && cfg.jestArgs.length) {
|
|
60158
60182
|
t2.push(...cfg.jestArgs);
|
|
60159
60183
|
}
|
|
@@ -60240,6 +60264,7 @@ var program = async () => {
|
|
|
60240
60264
|
coverageAbortOnFailure,
|
|
60241
60265
|
onlyFailures,
|
|
60242
60266
|
showLogs,
|
|
60267
|
+
sequential,
|
|
60243
60268
|
bootstrapCommand,
|
|
60244
60269
|
selectionSpecified,
|
|
60245
60270
|
selectionPaths,
|
|
@@ -60946,7 +60971,7 @@ var program = async () => {
|
|
|
60946
60971
|
os4.tmpdir(),
|
|
60947
60972
|
`jest-bridge-${Date.now()}-${Math.random().toString(36).slice(2)}.json`
|
|
60948
60973
|
);
|
|
60949
|
-
const reporterPath = path13.
|
|
60974
|
+
const reporterPath = path13.join(os4.tmpdir(), "headlamp", "jest-vitest-bridge.cjs");
|
|
60950
60975
|
try {
|
|
60951
60976
|
const needsWrite = (() => {
|
|
60952
60977
|
try {
|
|
@@ -60960,7 +60985,7 @@ var program = async () => {
|
|
|
60960
60985
|
fsSync3.mkdirSync(path13.dirname(reporterPath), { recursive: true });
|
|
60961
60986
|
fsSync3.writeFileSync(reporterPath, JEST_BRIDGE_REPORTER_SOURCE, "utf8");
|
|
60962
60987
|
}
|
|
60963
|
-
const envPath = path13.
|
|
60988
|
+
const envPath = path13.join(os4.tmpdir(), "headlamp", "jest-bridge-env.cjs");
|
|
60964
60989
|
try {
|
|
60965
60990
|
const existingEnv = fsSync3.readFileSync(envPath, "utf8");
|
|
60966
60991
|
if (existingEnv !== JEST_BRIDGE_ENV_SOURCE) {
|
|
@@ -61234,7 +61259,8 @@ ${stripFooter(rawAlso)}`.trimEnd();
|
|
|
61234
61259
|
jestExitCode = code;
|
|
61235
61260
|
}
|
|
61236
61261
|
};
|
|
61237
|
-
|
|
61262
|
+
const stride = sequential ? 1 : 3;
|
|
61263
|
+
await runParallelStride(projectsToRun, stride, async (cfg, index) => {
|
|
61238
61264
|
await runOneProject(cfg);
|
|
61239
61265
|
});
|
|
61240
61266
|
} else {
|