Skip to content

Commit b4ae15e

Browse files
authored
feat!: support new Vitest 4 syntax (#18)
1 parent ea66bf7 commit b4ae15e

File tree

9 files changed

+857
-379
lines changed

9 files changed

+857
-379
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
strategy:
4747
matrix:
4848
os: [ubuntu-latest]
49-
node_version: [20]
49+
node_version: [22]
5050
include:
51-
- os: macos-14
52-
node_version: 20
51+
- os: macos-latest
52+
node_version: 22
5353
- os: windows-latest
54-
node_version: 20
54+
node_version: 22
5555
fail-fast: false
5656

5757
steps:

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Render Vue components in Vitest Browser Mode. This library follows [`testing-library` principles](https://testing-library.com/docs/guiding-principles/) and exposes only [locators](https://vitest.dev/guide/browser/locators) and utilities that encourage you to write tests that closely resemble how your Vue components are used.
44

5-
Requires `vitest` and `@vitest/browser` 2.1.0 or higher.
5+
Requires `vitest` 4.0.0 or higher.
66

77
```ts
88
import { render } from 'vitest-browser-vue'
@@ -34,15 +34,14 @@ export default defineConfig({
3434
// import `vitest-browser-vue` manually so TypeScript can pick it up
3535
setupFiles: ['vitest-browser-vue'],
3636
browser: {
37-
name: 'chromium',
38-
enabled: true,
37+
// ... your config
3938
},
4039
},
4140
})
4241
```
4342

4443
```ts
45-
import { page } from '@vitest/browser/context'
44+
import { page } from 'vitest/browser'
4645

4746
test('counter button increments the count', async () => {
4847
const screen = page.render(Component, {

package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"./pure": {
3030
"types": "./dist/pure.d.ts",
3131
"default": "./dist/pure.js"
32-
}
32+
},
33+
"./package.json": "./package.json"
3334
},
3435
"main": "./dist/index.js",
3536
"module": "./dist/index.js",
@@ -39,9 +40,6 @@
3940
"*.mjs",
4041
"dist"
4142
],
42-
"engines": {
43-
"node": "^18.0.0 || >=20.0.0"
44-
},
4543
"scripts": {
4644
"build": "tsup",
4745
"dev": "tsup --watch --sourcemap",
@@ -52,8 +50,7 @@
5250
"lint:fix": "pnpm lint --fix"
5351
},
5452
"peerDependencies": {
55-
"@vitest/browser": "^2.1.0 || ^3.0.0 || ^4.0.0-0",
56-
"vitest": "^2.1.0 || ^3.0.0 || ^4.0.0-0",
53+
"vitest": "^4.0.0-0",
5754
"vue": "^3.0.0"
5855
},
5956
"dependencies": {
@@ -62,15 +59,15 @@
6259
"devDependencies": {
6360
"@antfu/eslint-config": "^2.24.1",
6461
"@vitejs/plugin-vue": "^5.1.2",
65-
"@vitest/browser": "^3.0.0",
62+
"@vitest/browser-playwright": "^4.0.0-beta.15",
6663
"bumpp": "^9.4.2",
6764
"changelogithub": "^0.13.9",
6865
"eslint": "^9.8.0",
69-
"playwright": "^1.46.0",
66+
"playwright": "^1.55.1",
7067
"tsup": "^8.2.4",
7168
"tsx": "^4.16.5",
7269
"typescript": "^5.5.4",
73-
"vitest": "^3.0.0",
70+
"vitest": "^4.0.0-beta.15",
7471
"vue": "^3.4.35",
7572
"zx": "^8.1.4"
7673
}

0 commit comments

Comments
 (0)