Skip to content

Commit a74a40b

Browse files
authored
chore: move dependencies out of snap test case (#264)
### TL;DR Added `@vitest/browser-playwright` as a catalog dependency ### What changed? - Added `@vitest/browser-playwright` to the CLI package dependencies - Removed the `@vitest/browser-playwright` dependency from the vitest-browser-mode snap test package.json - Modified the vitest-browser-mode snap test to no longer run `vite install` before tests - Updated the snap test output to reflect these changes ### How to test? 1. Run the vitest-browser-mode snap test to verify it works without the explicit installation step 2. Verify that browser tests using Playwright work correctly with the updated dependencies ### Why make this change? This change streamlines the testing process by making `@vitest/browser-playwright` available as a catalog dependency rather than requiring it to be installed separately in each test. This eliminates the need for an explicit installation step in the vitest-browser-mode snap test, making the testing workflow more efficient and consistent.
1 parent c7be908 commit a74a40b

6 files changed

Lines changed: 87 additions & 82 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@napi-rs/cli": "catalog:",
4747
"@oxc-node/core": "catalog:",
4848
"@vitest/browser": "catalog:",
49+
"@vitest/browser-playwright": "catalog:",
4950
"@voidzero-dev/vite-plus-tools": "workspace:",
5051
"playwright": "catalog:",
5152
"rolldown": "catalog:"
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"name": "vitest-browser-mode",
33
"version": "1.0.0",
4-
"packageManager": "pnpm@10.19.0",
5-
"dependencies": {
6-
"@vitest/browser-playwright": "^4.0.1"
7-
}
4+
"packageManager": "pnpm@10.19.0"
85
}

packages/cli/snap-tests/vitest-browser-mode/snap.txt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
> vite install
2-
Packages: +<variable>
3-
+<repeat>
4-
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done
5-
6-
dependencies:
7-
+ @vitest/browser-playwright <semver>
8-
9-
╭ Warning ─────────────────────────────────────────────────────────────────────╮
10-
│ │
11-
│ Ignored build scripts: esbuild. │
12-
│ Run "pnpm approve-builds" to pick which dependencies should be allowed │
13-
│ to run scripts. │
14-
│ │
15-
╰──────────────────────────────────────────────────────────────────────────────╯
16-
17-
Done in <variable>ms using pnpm v<semver>
18-
19-
201
> vite test
212

223
RUN v<semver> <cwd>

packages/cli/snap-tests/vitest-browser-mode/steps.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"VITE_DISABLE_AUTO_INSTALL": "1"
44
},
55
"commands": [
6-
"vite install",
76
"vite test",
87
"echo //comment >> src/foo.js",
98
"vite test",

pnpm-lock.yaml

Lines changed: 82 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ catalog:
1111
'@types/node': ^24.9.1
1212
'@types/react': ^19.1.8
1313
'@types/react-dom': ^19.1.6
14-
'@vitest/browser': ^4.0.3
14+
'@vitest/browser': ^4.0.4
15+
'@vitest/browser-playwright': ^4.0.4
1516
create-tsdown: 0.0.3
1617
create-vite: ^8.0.0
1718
cross-spawn: ^7.0.5
@@ -34,7 +35,7 @@ catalog:
3435
typescript: ^5.9.3
3536
vite: npm:rolldown-vite@^7.1.19
3637
vitepress: 2.0.0-alpha.12
37-
vitest: ^4.0.3
38+
vitest: ^4.0.4
3839
vue: ^3.5.21
3940

4041
catalogMode: prefer

0 commit comments

Comments
 (0)