Skip to content

Commit fdfb34c

Browse files
committed
test(snapshots): migrate vp check cases to the PTY snapshot suite
Migrates the 30 hand-convertible `check-*` cases from `packages/cli/snap-tests` to the PTY snapshot suite under `crates/vite_cli_snapshots`, and removes the legacy dirs. The 4 `check-pass*` cases were already covered by net-new fixtures on main (same env + `vp check`), so their redundant legacy dirs are removed too. `fmt-check-with-vite-config` is left in place for the fmt migration. Part of #2116.
1 parent cfbc122 commit fdfb34c

213 files changed

Lines changed: 589 additions & 415 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.

packages/cli/snap-tests/check-all-skipped/package.json renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/check_all_skipped/package.json

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[[case]]
2+
name = "check_all_skipped"
3+
vp = "local"
4+
env = { VITE_DISABLE_AUTO_INSTALL = "1" }
5+
steps = [
6+
{ argv = ["vp", "check", "--no-fmt", "--no-lint"], continue-on-failure = true },
7+
]

packages/cli/snap-tests/check-all-skipped/snap.txt renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/check_all_skipped/snapshots/check_all_skipped.md

Lines changed: 8 additions & 1 deletion

packages/cli/snap-tests/check-cache-disabled/package.json renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/check_cache_disabled/package.json

File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[[case]]
2+
name = "check_cache_disabled"
3+
vp = "local"
4+
steps = [
5+
{ argv = ["vp", "run", "check"], comment = "vp check should have cache disabled without run.cache", continue-on-failure = true },
6+
]
Lines changed: 11 additions & 0 deletions

packages/cli/snap-tests/check-cache-disabled/src/index.js renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/check_cache_disabled/src/index.js

File renamed without changes.

packages/cli/snap-tests/check-cache-enabled/package.json renamed to crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/check_cache_enabled/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 = "check_cache_enabled"
3+
vp = "local"
4+
skip-platforms = ["windows"]
5+
steps = [
6+
{ argv = ["vp", "run", "check"], comment = "first run should be cache miss", continue-on-failure = true },
7+
{ argv = ["vp", "run", "check"], comment = "second run should be cache hit", continue-on-failure = true },
8+
{ argv = ["vpt", "write-file", "src/foo.js", "export const foo = 1;\n"], continue-on-failure = true },
9+
{ argv = ["vp", "run", "check"], comment = "third run should be cache miss after new file added", continue-on-failure = true },
10+
]
Lines changed: 40 additions & 0 deletions

0 commit comments

Comments
 (0)