Skip to content

Commit 7a72f29

Browse files
committed
fix(snap-test): filter unstable bun "Saved lockfile" output
Bun intermittently prints "Saved lockfile" depending on cache state. Filter this line in the snap test output sanitizer for stable snapshots.
1 parent ad6df10 commit 7a72f29

7 files changed

Lines changed: 1 addition & 13 deletions

File tree

packages/cli/snap-tests-global/command-add-bun/snap.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ For more information, try '--help'.
3838

3939
> vp add testnpm2 -D && cat package.json # should add package as dev dependencies
4040
bun add v<semver> (af24e281)
41-
Saved lockfile
4241

4342
installed testnpm2@<semver>
4443

@@ -54,7 +53,6 @@ installed testnpm2@<semver>
5453

5554
> vp add testnpm2 test-vite-plus-install && cat package.json # should add packages to dependencies
5655
bun add v<semver> (af24e281)
57-
Saved lockfile
5856

5957
installed testnpm2@<semver>
6058
installed test-vite-plus-install@<semver>
@@ -76,7 +74,6 @@ installed test-vite-plus-install@<semver>
7674
VITE+ - The Unified Toolchain for the Web
7775

7876
bun add v<semver> (af24e281)
79-
Saved lockfile
8077

8178
installed test-vite-plus-package@<semver>
8279

@@ -98,7 +95,6 @@ installed test-vite-plus-package@<semver>
9895

9996
> vp add test-vite-plus-package-optional -O && cat package.json # should add package as optional dependencies
10097
bun add v<semver> (af24e281)
101-
Saved lockfile
10298

10399
installed test-vite-plus-package-optional@<semver>
104100

packages/cli/snap-tests-global/command-list-bun/snap.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
VITE+ - The Unified Toolchain for the Web
33

44
bun install v<semver> (af24e281)
5-
Saved lockfile
65

76
+ test-vite-plus-package@<semver>
87
+ test-vite-plus-package-optional@<semver>

packages/cli/snap-tests-global/command-outdated-bun/snap.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Documentation: https://viteplus.dev/guide/install
3030
VITE+ - The Unified Toolchain for the Web
3131

3232
bun install v<semver> (af24e281)
33-
Saved lockfile
3433

3534
+ test-vite-plus-top-package@<semver>
3635
+ test-vite-plus-other-optional@<semver>

packages/cli/snap-tests-global/command-remove-bun/snap.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,16 @@ package.json doesn't have dependencies, there's nothing to remove!
4242

4343
> vp add testnpm2 && vp add -D test-vite-plus-install && vp add -O test-vite-plus-package-optional && cat package.json # should add packages to dependencies
4444
bun add v<semver> (af24e281)
45-
Saved lockfile
4645

4746
installed testnpm2@<semver>
4847

4948
1 package installed [<variable>ms]
5049
bun add v<semver> (af24e281)
51-
Saved lockfile
5250

5351
installed test-vite-plus-install@<semver>
5452

5553
1 package installed [<variable>ms]
5654
bun add v<semver> (af24e281)
57-
Saved lockfile
5855

5956
installed test-vite-plus-package-optional@<semver>
6057

@@ -76,7 +73,6 @@ installed test-vite-plus-package-optional@<semver>
7673

7774
> vp remove testnpm2 test-vite-plus-install && cat package.json # should remove packages from dependencies
7875
bun remove v<semver> (af24e281)
79-
Saved lockfile
8076

8177
- testnpm2
8278
- test-vite-plus-install

packages/cli/snap-tests-global/command-update-bun/snap.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Documentation: https://viteplus.dev/guide/install
2828

2929
> vp update testnpm2 && cat package.json # should update package within semver range
3030
bun update v<semver> (af24e281)
31-
Saved lockfile
3231

3332
+ test-vite-plus-package@<semver>
3433
+ test-vite-plus-package-optional@<semver>
@@ -53,7 +52,6 @@ installed testnpm2@<semver>
5352

5453
> vp up testnpm2 --latest && cat package.json # should update to absolute latest version
5554
bun update v<semver> (af24e281)
56-
Saved lockfile
5755

5856
installed testnpm2@<semver>
5957

packages/cli/snap-tests-global/command-why-bun/snap.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Documentation: https://viteplus.dev/guide/install
3232
VITE+ - The Unified Toolchain for the Web
3333

3434
bun install v<semver> (af24e281)
35-
Saved lockfile
3635

3736
+ test-vite-plus-package@<semver>
3837
+ test-vite-plus-package-optional@<semver>

packages/tools/src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export function replaceUnstableOutput(output: string, cwd?: string) {
8787
.replaceAll(/Resolving dependencies\n/g, '')
8888
.replaceAll(/Resolved, downloaded and extracted \[\d+\]\n/g, '')
8989
.replaceAll(/Resolving\.\.\. /g, '')
90+
.replaceAll(/Saved lockfile\n/g, '')
9091
.replaceAll(/ \(v\d+\.\d+\.\d+ available\)/g, '')
9192
// ignore yarn YN0013, because it's unstable output, only exists on CI environment
9293
// ➤ YN0013: │ A package was added to the project (+ 0.7 KiB).

0 commit comments

Comments
 (0)