Skip to content

Commit 77eb0ca

Browse files
committed
test(snapshots): migrate the local npm install case to the PTY snapshot suite
Migrates npm-install-with-options (the one local npm-* case) from packages/cli/snap-tests to the PTY snapshot suite, and removes the legacy dir. The 10 npm-global-* cases stay in the legacy tree for now: they rely on shell primitives the no-shell runner cannot yet express (test -L symlink checks, $VP_HOME / $(pwd) expansion, invoking the installed global CLIs, dynamic NPM_CONFIG_PREFIX), which need new vpt/runner support. Part of #2116.
1 parent cf1e623 commit 77eb0ca

5 files changed

Lines changed: 36 additions & 14 deletions

File tree

packages/cli/snap-tests/npm-install-with-options/package.json renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/package.json

File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[[case]]
2+
name = "npm_install_with_options"
3+
vp = "local"
4+
steps = [
5+
{ argv = ["vp", "install", "--help"], comment = "print help message", continue-on-failure = true },
6+
{ argv = ["vp", "run", "install"], comment = "https://docs.npmjs.com/cli/v10/commands/npm-install", continue-on-failure = true },
7+
{ argv = ["vpt", "list-dir", "node_modules"], continue-on-failure = true },
8+
{ argv = ["vp", "run", "install"], comment = "install again hit cache", continue-on-failure = true },
9+
{ argv = ["vp", "run", "--last-details"], continue-on-failure = true },
10+
]

packages/cli/snap-tests/npm-install-with-options/snap.txt renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/snapshots/npm_install_with_options.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
> vp install --help # print help message
1+
# npm_install_with_options
2+
3+
## `vp install --help`
4+
5+
print help message
6+
7+
```
28
Install all dependencies, or add packages if package names are provided
39
410
Usage: vp install [OPTIONS] [PACKAGES]... [-- <PASS_THROUGH_ARGS>...]
@@ -33,20 +39,34 @@ Options:
3339
--node <NODE> Node.js version to use for global installation (only with -g)
3440
--concurrency <CONCURRENCY> Number of global package installs to run in parallel (only with -g)
3541
-h, --help Print help
42+
```
43+
44+
## `vp run install`
3645

37-
> vp run install # https://docs.npmjs.com/cli/v10/commands/npm-install
46+
https://docs.npmjs.com/cli/v10/commands/npm-install
47+
48+
```
3849
$ vp install --prod --silent ⊘ cache disabled
50+
```
3951

52+
## `vpt list-dir node_modules`
4053

41-
> ls node_modules
54+
```
4255
@oxlint
4356
tslib
57+
```
58+
59+
## `vp run install`
60+
61+
install again hit cache
4462

45-
> vp run install # install again hit cache
63+
```
4664
$ vp install --prod --silent ⊘ cache disabled
65+
```
4766

67+
## `vp run --last-details`
4868

49-
> vp run --last-details
69+
```
5070
5171
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5272
Vite+ Task Runner • Execution Summary
@@ -60,3 +80,4 @@ Task Details:
6080
[1] npm-install-with-options#install: $ vp install --prod --silent ✓
6181
→ Cache disabled in task configuration
6282
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83+
```

packages/cli/snap-tests/npm-install-with-options/vite.config.ts renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/vite.config.ts

File renamed without changes.

packages/cli/snap-tests/npm-install-with-options/steps.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)