GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(snapshots): migrate `env-*` cases to the PTY snapshot suite by fengmk2 · Pull Request #2137 · voidzero-dev/vite-plus

test(snapshots): migrate env-* cases to the PTY snapshot suite #2137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
graphite-app merged 1 commit into main from migrate-env-snap-tests
Jul 10, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

test(snapshots): migrate env-* cases to the PTY snapshot suite #2137

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
e13e029
test(snapshots): migrate `env-*` cases to the PTY snapshot suite (#2137)
fengmk2 Jul 10, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

0 ...env-install-binary-conflict/.node-version → ...env_install_binary_conflict/.node-version
Show comments
View file
Open in desktop
File renamed without changes.
0 ...conflict/env-binary-conflict-pkg-a/cli.js → ...conflict/env-binary-conflict-pkg-a/cli.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...ct/env-binary-conflict-pkg-a/package.json → ...ct/env-binary-conflict-pkg-a/package.json
Show comments
View file
Open in desktop
File renamed without changes.
0 ...conflict/env-binary-conflict-pkg-b/cli.js → ...conflict/env-binary-conflict-pkg-b/cli.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...ct/env-binary-conflict-pkg-b/package.json → ...ct/env-binary-conflict-pkg-b/package.json
Show comments
View file
Open in desktop
File renamed without changes.
14 changes: 14 additions & 0 deletions 14 ...ite_cli_snapshots/tests/cli_snapshots/fixtures/env_install_binary_conflict/snapshots.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[case]]
name = "env_install_binary_conflict"
vp = "global"
skip-platforms = ["windows"]
steps = [
{ argv = ["vp", "install", "-g", "./env-binary-conflict-pkg-a"], comment = "Install pkg-a which provides env-binary-conflict-cli binary", continue-on-failure = true },
{ argv = ["vpt", "print-file", "$VP_HOME/bins/env-binary-conflict-cli.json"], comment = "Bin config should point to pkg-a", continue-on-failure = true },
{ argv = ["vp", "install", "-g", "./env-binary-conflict-pkg-b"], comment = "Try to install pkg-b without force - should fail", continue-on-failure = true },
{ argv = ["vpt", "print-file", "$VP_HOME/bins/env-binary-conflict-cli.json"], comment = "Bin config should still point to pkg-a", continue-on-failure = true },
{ argv = ["vp", "install", "-g", "--force", "./env-binary-conflict-pkg-b"], comment = "Force install pkg-b - should auto-uninstall pkg-a", continue-on-failure = true },
{ argv = ["vpt", "print-file", "$VP_HOME/bins/env-binary-conflict-cli.json"], comment = "Bin config should now point to pkg-b", continue-on-failure = true },
{ argv = ["vp", "remove", "-g", "env-binary-conflict-pkg-b"], comment = "Cleanup", continue-on-failure = true },
{ argv = ["vpt", "stat-file", "$VP_HOME/bins/env-binary-conflict-cli.json", "--assert", "missing"], comment = "Bin config should be deleted", continue-on-failure = true },
]
100 changes: 100 additions & 0 deletions 100 ...s/fixtures/env_install_binary_conflict/snapshots/env_install_binary_conflict.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# env_install_binary_conflict

## `vp install -g ./env-binary-conflict-pkg-a`

Install pkg-a which provides env-binary-conflict-cli binary

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
✓ Installed env-binary-conflict-pkg-a 1.0.0
Bins: env-binary-conflict-cli
```

## `vpt print-file $VP_HOME/bins/env-binary-conflict-cli.json`

Bin config should point to pkg-a

```
{
"name": "env-binary-conflict-cli",
"package": "env-binary-conflict-pkg-a",
"version": "1.0.0",
"nodeVersion": "<version>",
"source": "vp"
}
```

## `vp install -g ./env-binary-conflict-pkg-b`

Try to install pkg-b without force - should fail

**Exit code:** 1

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
error: Failed to install env-binary-conflict-pkg-b: Executable 'env-binary-conflict-cli' is already installed by env-binary-conflict-pkg-a

Please remove env-binary-conflict-pkg-a before installing env-binary-conflict-pkg-b, or use --force to auto-replace
```

## `vpt print-file $VP_HOME/bins/env-binary-conflict-cli.json`

Bin config should still point to pkg-a

```
{
"name": "env-binary-conflict-cli",
"package": "env-binary-conflict-pkg-a",
"version": "1.0.0",
"nodeVersion": "<version>",
"source": "vp"
}
```

## `vp install -g --force ./env-binary-conflict-pkg-b`

Force install pkg-b - should auto-uninstall pkg-a

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
Uninstalling env-binary-conflict-pkg-a (conflicts with env-binary-conflict-pkg-b)...
Uninstalled env-binary-conflict-pkg-a
✓ Installed env-binary-conflict-pkg-b 2.0.0
Bins: env-binary-conflict-cli
```

## `vpt print-file $VP_HOME/bins/env-binary-conflict-cli.json`

Bin config should now point to pkg-b

```
{
"name": "env-binary-conflict-cli",
"package": "env-binary-conflict-pkg-b",
"version": "2.0.0",
"nodeVersion": "<version>",
"source": "vp"
}
```

## `vp remove -g env-binary-conflict-pkg-b`

Cleanup

```
Uninstalled env-binary-conflict-pkg-b
```

## `vpt stat-file $VP_HOME/bins/env-binary-conflict-cli.json --assert missing`

Bin config should be deleted

```
<home>/.vite-plus/bins/env-binary-conflict-cli.json: missing
```
0 ...lobal/env-install-interrupt/.node-version → ...tures/env_install_interrupt/.node-version
Show comments
View file
Open in desktop
File renamed without changes.
0 ...install-interrupt/check-stale-packages.js → ...install_interrupt/check-stale-packages.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...nterrupt/long-time-install-package/cli.js → ...nterrupt/long-time-install-package/cli.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...pt/long-time-install-package/package.json → ...pt/long-time-install-package/package.json
Show comments
View file
Open in desktop
File renamed without changes.
0 .../long-time-install-package/postinstall.js → .../long-time-install-package/postinstall.js
Show comments
View file
Open in desktop
File renamed without changes.
19 changes: 19 additions & 0 deletions 19 crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/env_install_interrupt/snapshots.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[case]]
name = "env_install_interrupt"
vp = "global"
steps = [
{ argv = ["vp", "install", "-g", "./long-time-install-package"], continue-on-failure = true },
{ argv = ["long-time-install-package"], continue-on-failure = true },
# snapshot = false: the killed install's partial screen is timing-dependent
# (which spinner frame was live at the 100ms SIGKILL) and ConPTY renders a
# trailing blank line Unix does not; the meaningful outcome is asserted by
# the check-stale-packages step that follows.
{ argv = ["node", "test-reinstall-interrupt.js"], comment = "Reinstall but interrupt", snapshot = false, continue-on-failure = true },
{ argv = ["long-time-install-package"], comment = "Original package should be still runnable", continue-on-failure = true },
{ argv = ["node", "check-stale-packages.js", "--expect-stale"], comment = "Interrupted reinstall should leave stale package", continue-on-failure = true },
{ argv = ["vp", "install", "-g", "./long-time-install-package"], comment = "Successful reinstall should clean stale packages", continue-on-failure = true },
{ argv = ["node", "check-stale-packages.js"], continue-on-failure = true },
]
after = [
{ argv = ["vp", "remove", "-g", "@scope/long-time-install-package"], continue-on-failure = true },
]
56 changes: 56 additions & 0 deletions 56 ...cli_snapshots/fixtures/env_install_interrupt/snapshots/env_install_interrupt.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# env_install_interrupt

## `vp install -g ./long-time-install-package`

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
✓ Installed @scope/long-time-install-package 0.0.0
Bins: long-time-install-package
```

## `long-time-install-package`

```
long-time-install-package
```

## `node test-reinstall-interrupt.js`

Reinstall but interrupt


## `long-time-install-package`

Original package should be still runnable

```
long-time-install-package
```

## `node check-stale-packages.js --expect-stale`

Interrupted reinstall should leave stale package

```
interrupted stale package exists
```

## `vp install -g ./long-time-install-package`

Successful reinstall should clean stale packages

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
✓ Installed @scope/long-time-install-package 0.0.0
Bins: long-time-install-package
```

## `node check-stale-packages.js`

```
interrupted stale package removed
```
0 ...all-interrupt/test-reinstall-interrupt.js → ...all_interrupt/test-reinstall-interrupt.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...-global/env-install-mixed-case-bin/cli.js → ...ixtures/env_install_mixed_case_bin/cli.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...l/env-install-mixed-case-bin/package.json → ...s/env_install_mixed_case_bin/package.json
Show comments
View file
Open in desktop
File renamed without changes.
10 changes: 10 additions & 0 deletions 10 ...vite_cli_snapshots/tests/cli_snapshots/fixtures/env_install_mixed_case_bin/snapshots.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[case]]
name = "env_install_mixed_case_bin"
vp = "global"
steps = [
{ argv = ["vp", "install", "-g", "."], continue-on-failure = true },
{ argv = ["MixedCaseBin"], continue-on-failure = true },
]
after = [
{ argv = ["vp", "remove", "-g", "env-install-mixed-case-bin"], continue-on-failure = true },
]
17 changes: 17 additions & 0 deletions 17 ...ots/fixtures/env_install_mixed_case_bin/snapshots/env_install_mixed_case_bin.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# env_install_mixed_case_bin

## `vp install -g .`

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
✓ Installed env-install-mixed-case-bin 1.0.0
Bins: MixedCaseBin
```

## `MixedCaseBin`

```
mixed-case bin executed
```
0 ...v-install-stale-bin/check-stale-binary.js → ...v_install_stale_bin/check-stale-binary.js
Show comments
View file
Open in desktop
File renamed without changes.
0 .../env-install-stale-bin-pkg-v1/cli-drop.js → .../env-install-stale-bin-pkg-v1/cli-drop.js
Show comments
View file
Open in desktop
File renamed without changes.
0 .../env-install-stale-bin-pkg-v1/cli-keep.js → .../env-install-stale-bin-pkg-v1/cli-keep.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...env-install-stale-bin-pkg-v1/package.json → ...env-install-stale-bin-pkg-v1/package.json
Show comments
View file
Open in desktop
File renamed without changes.
0 .../env-install-stale-bin-pkg-v2/cli-keep.js → .../env-install-stale-bin-pkg-v2/cli-keep.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...env-install-stale-bin-pkg-v2/package.json → ...env-install-stale-bin-pkg-v2/package.json
Show comments
View file
Open in desktop
File renamed without changes.
14 changes: 14 additions & 0 deletions 14 crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/env_install_stale_bin/snapshots.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[case]]
name = "env_install_stale_bin"
vp = "global"
steps = [
{ argv = ["vp", "install", "-g", "./env-install-stale-bin-pkg-v1"], comment = "Install package with two binaries", continue-on-failure = true },
{ argv = ["env-install-stale-keep"], comment = "Both binaries should be callable" },
{ argv = ["env-install-stale-drop"], continue-on-failure = true },
{ argv = ["vp", "install", "-g", "./env-install-stale-bin-pkg-v2"], comment = "Reinstall package version that removed one binary", continue-on-failure = true },
{ argv = ["env-install-stale-keep"], comment = "Remaining binary should still be callable", continue-on-failure = true },
{ argv = ["node", "check-stale-binary.js"], continue-on-failure = true },
]
after = [
{ argv = ["vp", "remove", "-g", "env-install-stale-bin-pkg"], continue-on-failure = true },
]
54 changes: 54 additions & 0 deletions 54 ...cli_snapshots/fixtures/env_install_stale_bin/snapshots/env_install_stale_bin.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# env_install_stale_bin

## `vp install -g ./env-install-stale-bin-pkg-v1`

Install package with two binaries

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
✓ Installed env-install-stale-bin-pkg 1.0.0
Bins: env-install-stale-drop, env-install-stale-keep
```

## `env-install-stale-keep`

Both binaries should be callable

```
env-install-stale-keep ok
```

## `env-install-stale-drop`

```
env-install-stale-drop ok
```

## `vp install -g ./env-install-stale-bin-pkg-v2`

Reinstall package version that removed one binary

```
VITE+ - The Unified Toolchain for the Web

info: Installing 1 global package with Node.js <version>
✓ Installed env-install-stale-bin-pkg 2.0.0
Bins: env-install-stale-keep
```

## `env-install-stale-keep`

Remaining binary should still be callable

```
env-install-stale-keep ok
```

## `node check-stale-binary.js`

```
stale shim removed
stale config removed
```
0 ...-node-child-process-npm/node/package.json → ..._node_child_process_npm/node/package.json
Show comments
View file
Open in desktop
File renamed without changes.
0 ...l/env-node-child-process-npm/package.json → ...s/env_node_child_process_npm/package.json
Show comments
View file
Open in desktop
File renamed without changes.
0 .../env-node-child-process-npm/print-path.js → .../env_node_child_process_npm/print-path.js
Show comments
View file
Open in desktop
File renamed without changes.
0 ...v-node-child-process-npm/print-version.js → ...v_node_child_process_npm/print-version.js
Show comments
View file
Open in desktop
File renamed without changes.
19 changes: 19 additions & 0 deletions 19 ...vite_cli_snapshots/tests/cli_snapshots/fixtures/env_node_child_process_npm/snapshots.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[case]]
name = "env_node_child_process_npm"
vp = "global"
skip-platforms = ["windows"]
comment = """
The legacy case compared `$(npm --version)` against a node child process's
`npm --version` via shell command substitution. There is no shell, but both
projects pin the resolution deterministically (node/ pins the runtime, so its
bundled npm version is fixed; specific/ pins devEngines.packageManager), so the
snapshot itself asserts the resolved versions, and print-path.js asserts the
child process resolves npm to the vp shim.
"""
steps = [
{ argv = ["node", "../print-version.js"], cwd = "node", comment = "child-process npm is the pinned runtime's bundled npm", continue-on-failure = true },
{ argv = ["node", "../print-path.js"], cwd = "node", comment = "child-process npm resolves to the vp shim", continue-on-failure = true },
{ argv = ["node", "../print-version.js"], cwd = "specific", comment = "child-process npm is the devEngines.packageManager pin", continue-on-failure = true },
{ argv = ["node", "./print-package-json-pm-version.js"], cwd = "specific", comment = "the pin itself, for comparison with the step above", continue-on-failure = true },
{ argv = ["node", "../print-path.js"], cwd = "specific", comment = "child-process npm resolves to the vp shim", continue-on-failure = true },
]
48 changes: 48 additions & 0 deletions 48 ...ots/fixtures/env_node_child_process_npm/snapshots/env_node_child_process_npm.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# env_node_child_process_npm

The legacy case compared `$(npm --version)` against a node child process's
`npm --version` via shell command substitution. There is no shell, but both
projects pin the resolution deterministically (node/ pins the runtime, so its
bundled npm version is fixed; specific/ pins devEngines.packageManager), so the
snapshot itself asserts the resolved versions, and print-path.js asserts the
child process resolves npm to the vp shim.

## `cd node && node ../print-version.js`

child-process npm is the pinned runtime's bundled npm

```
10.8.2
```

## `cd node && node ../print-path.js`

child-process npm resolves to the vp shim

```
<home>/.vite-plus/js_runtime/node/<version>/bin/npm
```

## `cd specific && node ../print-version.js`

child-process npm is the devEngines.packageManager pin

```
11.17.0
```

## `cd specific && node ./print-package-json-pm-version.js`

the pin itself, for comparison with the step above

```
11.17.0
```

## `cd specific && node ../print-path.js`

child-process npm resolves to the vp shim

```
<home>/.vite-plus/package_manager/npm/<version>/npm/bin/npm
```
0 ...e-child-process-npm/specific/package.json → ...e_child_process_npm/specific/package.json
Show comments
View file
Open in desktop
File renamed without changes.
0 ...specific/print-package-json-pm-version.js → ...specific/print-package-json-pm-version.js
Show comments
View file
Open in desktop
File renamed without changes.
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.