Skip to content

Commit df5abf7

Browse files
committed
docs(test): add just snapshot-test-global for checkouts without a JS build
Round-8 review follow-up: absent dist stays a deliberate fail-fast with remedies in the message (auto-building would drag the rolldown chain into the recipe; auto-skipping would hide coverage), and toolchain-only contributors get a first-class entry point instead. Claude-Session: https://claude.ai/code/session_01NRgjMi2Vus3iJctudGEWPT
1 parent 7660d05 commit df5abf7

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

crates/vite_cli_snapshots/tests/cli_snapshots/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ the stored snapshot. Never hand-edit `.md` snapshots; re-record instead.
4444
```bash
4545
just snapshot-test # build vp, run everything
4646
just snapshot-test <substring> # filter by trial name
47+
just snapshot-test-global # no JS build needed (skips local flavor)
4748
UPDATE_SNAPSHOTS=1 just snapshot-test # accept snapshot changes
4849
pnpm snapshot-test # same, via pnpm
4950
cargo test -p vite_cli_snapshots -- <filter> # if vp is already built

justfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,23 @@ test:
8383
# PTY-based CLI snapshot tests (crates/vite_cli_snapshots). Builds the global
8484
# binary first so the harness never tests a stale build. Filter by trial name
8585
# substring: `just snapshot-test create`. Accept snapshot changes with
86-
# `UPDATE_SNAPSHOTS=1 just snapshot-test`.
86+
# `UPDATE_SNAPSHOTS=1 just snapshot-test`. Local-flavor cases additionally
87+
# need a built packages/cli (`pnpm build`); the harness fails fast when dist
88+
# is missing or stale. Use snapshot-test-global on checkouts without one.
8789
snapshot-test *args='':
8890
cargo build -p vite_global_cli
8991
cargo test -p vite_cli_snapshots -- {{args}}
9092

93+
# Global flavor + vpt cases only: needs no JS build, for Rust-side work on
94+
# a checkout that never ran `pnpm build`.
95+
[unix]
96+
snapshot-test-global *args='':
97+
VP_SNAP_SKIP_FLAVORS=local just snapshot-test {{args}}
98+
99+
[windows]
100+
snapshot-test-global *args='':
101+
$Env:VP_SNAP_SKIP_FLAVORS='local'; just snapshot-test {{args}}
102+
91103
# Single source of truth for clippy, used by CI too. The `-A` flags allow
92104
# new toolchain lints that fire in upstream rolldown crates without a `[lints]` table.
93105
lint:

0 commit comments

Comments
 (0)