Skip to content

Commit 1d6cd0e

Browse files
committed
test(snapshots): pin the blank-line layout package managers repaint nondeterministically
pnpm decides at runtime whether to print its self-update banner box, and its progress repainting shifts how many blank lines surround section headers, per-project change-summary rows, and the "Done in" line; yarn appends "in Xs Ys" to its completion line only when a step is slow enough to time. Each of these raced the recorded baselines. Strip the banner box (guarded to boxes containing "Update available"), normalize yarn's completion tail, pin one blank line before dependency sections and "Done in", pin change-summary rows flush against the previous line, collapse longer blank runs, and trim trailing blanks. These normalizations run after every rule that strips whole lines (stack frames, progress rows, the banner itself) so a strip leaves the same layout as output where the stripped text never appeared. Path redaction gains two pairs: the dunce-canonicalized variant of each redacted path, because tools that canonicalize (pnpm link, yarn portals) print the resolved form of macOS /private symlinks, and the case root as <case>, because fixtures may create siblings of the workspace whose paths tools echo back. Re-record the baselines the pinned layout changes. Part of #2116.
1 parent 484349e commit 1d6cd0e

53 files changed

Lines changed: 123 additions & 112 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/command_config_yarn1/snapshots/command_config_yarn1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ warn: yarn@1 does not support --location, ignoring flag
3232
yarn config <version>
3333
warning package.json: No license field
3434
success Set "vite-plus-pm-config-test-key" to "test-value".
35+
3536
Done in <duration>.
3637
```
3738

@@ -54,5 +55,6 @@ warn: yarn@1 does not support --location, ignoring flag
5455
yarn config <version>
5556
warning package.json: No license field
5657
success Deleted "vite-plus-pm-config-test-key".
58+
5759
Done in <duration>.
5860
```

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4_with_workspace/snapshots/command_pack_yarn4_with_workspace.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ should pack all packages in workspace (uses workspaces foreach --all pack)
5353
[@vite-plus-test/utils]: ➤ YN0000: Package archive generated in <workspace>/packages/utils/package.tgz
5454
[@vite-plus-test/utils]: ➤ YN0000: Done in <duration> <duration>
5555
[@vite-plus-test/utils]: Process exited (exit code 0), completed in <duration> <duration>
56+
5657
Done in <duration> <duration>
5758
```
5859

@@ -66,6 +67,7 @@ should pack specific package (uses workspaces foreach --all --include app pack)
6667
[app]: ➤ YN0000: Package archive generated in <workspace>/packages/app/package.tgz
6768
[app]: ➤ YN0000: Done in <duration> <duration>
6869
[app]: Process exited (exit code 0), completed in <duration> <duration>
70+
6971
Done in <duration> <duration>
7072
```
7173

@@ -85,6 +87,7 @@ should pack multiple packages
8587
[@vite-plus-test/utils]: ➤ YN0000: Package archive generated in <workspace>/packages/utils/package.tgz
8688
[@vite-plus-test/utils]: ➤ YN0000: Done in <duration> <duration>
8789
[@vite-plus-test/utils]: Process exited (exit code 0), completed in <duration> <duration>
90+
8891
Done in <duration> <duration>
8992
```
9093

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/command_rebuild_pnpm11/snapshots/command_rebuild_pnpm11.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ set up node_modules
2828
```
2929
VITE+ - The Unified Toolchain for the Web
3030
31-
32-
╭──────────────────────────────────────────╮
33-
│ │
34-
│ Update available! 11.0.6 → 11.11.0. │
35-
│ Changelog: https://pnpm.io/v/11.11.0 │
36-
│ To update, run: pnpm add -g pnpm │
37-
│ │
38-
╰──────────────────────────────────────────╯
39-
40-
4131
dependencies:
4232
testnpm2 1.0.0 (1.0.1 is available)
4333

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/command_staged_with_config/snapshots/command_staged_with_config.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,18 @@
22

33
## `git init`
44

5-
65
## `git add -A`
76

8-
97
## `git commit -m init`
108

11-
129
## `vpt write-file src/index.ts 'export const hello = '\''world'\'';
1310
export const foo = 1;
1411
'`
1512

1613
append foo (write-file with the full appended content)
1714

18-
1915
## `git add src/index.ts`
2016

21-
2217
## `vp staged`
2318

2419
should succeed with staged .ts files
@@ -32,39 +27,30 @@ should succeed with staged .ts files
3227

3328
## `git add -A`
3429

35-
3630
## `git commit -m second`
3731

38-
3932
## `vpt write-file src/index.ts 'export const hello = '\''world'\'';
4033
export const foo = 1;
4134
export const bar = 2;
4235
'`
4336

4437
append bar
4538

46-
4739
## `git add src/index.ts`
4840

49-
5041
## `vp staged --debug`
5142

5243
should succeed with debug enabled
5344

54-
5545
## `git add -A`
5646

57-
5847
## `git commit -m third`
5948

60-
6149
## `vpt write-file src/fail.js 'eval("code");
6250
'`
6351

64-
6552
## `git add src/fail.js`
6653

67-
6854
## `vp staged`
6955

7056
should fail when staged .js file has lint errors

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/create_generator_monorepo/snapshots/create_generator_monorepo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ Running: node <workspace>/tools/my-generator/bin/index.ts --name demo-pkg --dire
100100
101101
└ Thanks for using my-generator! 💝
102102
103-
104103
Monorepo integration...
105104
106105
Installing dependencies...

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/migration_eslint_legacy/snapshots/migration_eslint_legacy.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ should show legacy eslint config warning
77
```
88
VITE+ - The Unified Toolchain for the Web
99
10-
1110
Legacy ESLint configuration detected (.eslintrc). Automatic migration to Oxlint requires ESLint v9+ with flat config format (eslint.config.*). Please upgrade to ESLint v9 first: https://eslint.org/docs/latest/use/migrate-to-9.0.0
1211
◇ Migrated . to Vite+ <version>
1312
• Node <version> pnpm <version>

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/migration_eslint_monorepo/snapshots/migration_eslint_monorepo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ migration should detect eslint in monorepo and migrate all packages
77
```
88
VITE+ - The Unified Toolchain for the Web
99
10-
1110
✔ Created vite.config.ts in vite.config.ts
1211
1312
✔ Merged .oxlintrc.json into vite.config.ts

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/migration_eslint_monorepo_package_only/snapshots/migration_eslint_monorepo_package_only.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ migration should warn about package-only eslint
77
```
88
VITE+ - The Unified Toolchain for the Web
99
10-
1110
ESLint detected in workspace packages but no root config found. Package-level ESLint must be migrated manually.
1211
◇ Migrated . to Vite+ <version>
1312
• Node <version> pnpm <version>

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/migration_eslint_monorepo_plugins_in_packages/snapshots/migration_eslint_monorepo_plugins_in_packages.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ workspace packages get the SAME aggressive cleanup as the root (deps, configs, l
77
```
88
VITE+ - The Unified Toolchain for the Web
99
10-
1110
✔ Created vite.config.ts in vite.config.ts
1211
1312
✔ Merged .oxlintrc.json into vite.config.ts

crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/migration_eslint_nuxt_skip/snapshots/migration_eslint_nuxt_skip.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
```
88
VITE+ - The Unified Toolchain for the Web
99
10-
1110
@nuxt/eslint detected — automatic ESLint migration is skipped. @nuxt/eslint wires ESLint into a framework-specific flow that Vite+ cannot migrate cleanly yet. Your ESLint setup is preserved. To migrate manually, remove @nuxt/eslint from package.json and re-run `vp migrate`.
1211
◇ Migrated . to Vite+ <version>
1312
• Node <version> pnpm <version>

0 commit comments

Comments
 (0)