Skip to content

Commit 5004721

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/expect-locator-to-have-screenshot
2 parents d3e74af + e71a5d0 commit 5004721

File tree

17 files changed

+1076
-841
lines changed

17 files changed

+1076
-841
lines changed

docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default ({ mode }: { mode: string }) => {
7676
'.spec.js': 'vscode-icons:file-type-testjs',
7777
'.test.js': 'vscode-icons:file-type-testjs',
7878
'marko': 'vscode-icons:file-type-marko',
79+
'qwik': 'logos:qwik-icon',
7980
},
8081
}),
8182
],

docs/guide/browser/index.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,24 @@ export default defineConfig({
207207
}
208208
})
209209
```
210+
```ts [qwik]
211+
import { defineConfig } from 'vitest/config'
212+
import { qwikVite } from '@builder.io/qwik/optimizer'
213+
214+
// optional, run the tests in SSR mode
215+
import { testSSR } from 'vitest-browser-qwik/ssr-plugin'
216+
217+
export default defineConfig({
218+
plugins: [testSSR(), qwikVite()],
219+
test: {
220+
browser: {
221+
enabled: true,
222+
provider: 'playwright',
223+
instances: [{ browser: 'chromium' }]
224+
},
225+
},
226+
})
227+
```
210228
:::
211229

212230
If you need to run some tests using Node-based runner, you can define a [`projects`](/guide/projects) option with separate configurations for different testing strategies:
@@ -411,6 +429,7 @@ Community packages are available for other frameworks:
411429

412430
- [`vitest-browser-lit`](https://github.com/EskiMojo14/vitest-browser-lit) to render [lit](https://lit.dev) components
413431
- [`vitest-browser-preact`](https://github.com/JoviDeCroock/vitest-browser-preact) to render [preact](https://preactjs.com) components
432+
- [`vitest-browser-qwik`](https://github.com/kunai-consulting/vitest-browser-qwik) to render [qwik](https://qwik.dev) components
414433

415434
If your framework is not represented, feel free to create your own package - it is a simple wrapper around the framework renderer and `page.elementLocator` API. We will add a link to it on this page. Make sure it has a name starting with `vitest-browser-`.
416435

@@ -516,6 +535,21 @@ test('greeting appears on click', async () => {
516535
await expect.element(greeting).toBeInTheDocument()
517536
})
518537
```
538+
```tsx [qwik]
539+
import { render } from 'vitest-browser-qwik'
540+
import Greeting from './greeting'
541+
542+
test('greeting appears on click', async () => {
543+
// renderSSR and renderHook are also available
544+
const screen = render(<Greeting />)
545+
546+
const button = screen.getByRole('button')
547+
await button.click()
548+
const greeting = screen.getByText(/hello world/iu)
549+
550+
await expect.element(greeting).toBeInTheDocument()
551+
})
552+
```
519553
:::
520554

521555
Vitest doesn't support all frameworks out of the box, but you can use external tools to run tests with these frameworks. We also encourage the community to create their own `vitest-browser` wrappers - if you have one, feel free to add it to the examples above.

docs/guide/improving-performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default defineConfig({
7979

8080
## Sharding
8181

82-
Test sharding is a process of splitting your test suite into groups, or shards. This can be useful when you have a large test suite and multiple matchines that could run subsets of that suite simultaneously.
82+
Test sharding is a process of splitting your test suite into groups, or shards. This can be useful when you have a large test suite and multiple machines that could run subsets of that suite simultaneously.
8383

8484
To split Vitest tests on multiple different runs, use [`--shard`](/guide/cli#shard) option with [`--reporter=blob`](/guide/reporters#blob-reporter) option:
8585

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"devDependencies": {
2121
"@iconify-json/carbon": "catalog:",
2222
"@iconify-json/logos": "catalog:",
23-
"@shikijs/transformers": "^3.8.0",
24-
"@shikijs/vitepress-twoslash": "^3.8.0",
23+
"@shikijs/transformers": "^3.8.1",
24+
"@shikijs/vitepress-twoslash": "^3.8.1",
2525
"@unocss/reset": "catalog:",
2626
"@vite-pwa/assets-generator": "^1.0.0",
2727
"@vite-pwa/vitepress": "^1.0.0",

examples/projects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@testing-library/react": "^13.4.0",
1414
"@testing-library/user-event": "^14.6.1",
1515
"@types/react": "^19.1.8",
16-
"@vitejs/plugin-react": "^4.6.0",
16+
"@vitejs/plugin-react": "^4.7.0",
1717
"@vitest/ui": "latest",
1818
"fastify": "^5.4.0",
1919
"jsdom": "^26.1.0",

examples/typecheck/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test:run": "vitest run"
1111
},
1212
"devDependencies": {
13-
"@types/node": "^20.19.7",
13+
"@types/node": "^20.19.9",
1414
"@vitest/ui": "latest",
1515
"typescript": "^5.8.3",
1616
"vite": "latest",

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@
3737
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
3838
},
3939
"devDependencies": {
40-
"@antfu/eslint-config": "^4.16.2",
40+
"@antfu/eslint-config": "^4.17.0",
4141
"@antfu/ni": "^25.0.0",
4242
"@playwright/test": "^1.54.1",
4343
"@rollup/plugin-commonjs": "^28.0.6",
4444
"@rollup/plugin-json": "^6.1.0",
4545
"@rollup/plugin-node-resolve": "^16.0.1",
46-
"@types/node": "^22.16.3",
46+
"@types/node": "^22.16.5",
4747
"@types/ws": "catalog:",
4848
"@vitest/browser": "workspace:*",
4949
"@vitest/coverage-istanbul": "workspace:*",
5050
"@vitest/coverage-v8": "workspace:*",
5151
"@vitest/ui": "workspace:*",
5252
"bumpp": "^10.2.0",
5353
"changelogithub": "^13.16.0",
54-
"esbuild": "^0.25.6",
54+
"esbuild": "^0.25.8",
5555
"eslint": "^9.31.0",
5656
"magic-string": "^0.30.17",
5757
"pathe": "^2.0.3",
5858
"rimraf": "^6.0.1",
59-
"rollup": "^4.45.0",
59+
"rollup": "^4.45.1",
6060
"rollup-plugin-dts": "^6.2.1",
6161
"rollup-plugin-license": "^3.6.0",
6262
"tinyglobby": "catalog:",
@@ -66,7 +66,7 @@
6666
"unplugin-oxc": "^0.4.6",
6767
"vite": "^6.3.5",
6868
"vitest": "workspace:*",
69-
"zx": "^8.7.0"
69+
"zx": "^8.7.1"
7070
},
7171
"pnpm": {
7272
"overrides": {

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,6 @@
119119
"playwright-core": "^1.54.1",
120120
"safaridriver": "^1.0.0",
121121
"vitest": "workspace:*",
122-
"webdriverio": "^9.17.0"
122+
"webdriverio": "^9.18.1"
123123
}
124124
}

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"d3-graph-controller": "^3.1.1",
7979
"floating-vue": "^5.2.2",
8080
"mime": "^4.0.7",
81-
"rollup": "^4.45.0",
81+
"rollup": "^4.45.1",
8282
"splitpanes": "^3.2.0",
8383
"unocss": "catalog:",
8484
"unplugin-auto-import": "^0.19.0",

packages/vitest/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"expect-type": "^1.2.2",
164164
"magic-string": "catalog:",
165165
"pathe": "catalog:",
166-
"picomatch": "^4.0.2",
166+
"picomatch": "^4.0.3",
167167
"std-env": "catalog:",
168168
"tinybench": "^2.9.0",
169169
"tinyexec": "^0.3.2",
@@ -185,8 +185,8 @@
185185
"@types/istanbul-reports": "catalog:",
186186
"@types/jsdom": "^21.1.7",
187187
"@types/mime": "^4.0.0",
188-
"@types/node": "^22.16.3",
189-
"@types/picomatch": "^4.0.0",
188+
"@types/node": "^22.16.5",
189+
"@types/picomatch": "^4.0.1",
190190
"@types/prompts": "^2.4.9",
191191
"@types/sinonjs__fake-timers": "^8.1.5",
192192
"acorn-walk": "catalog:",

0 commit comments

Comments
 (0)