You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To have a better type safety when using built-in providers, you should reference one of these types (for provider that you are using) in your [config file](/config/):
In addition to that, you can also specify most of the [project options](/config/) (not marked with a <NonProjectOption /> icon) and some of the `browser` options like `browser.testerHtmlPath`.
66
58
67
59
::: warning
@@ -100,26 +92,12 @@ List of available `browser` options:
By default, Vitest creates an array with a single element which uses the [`browser.name`](#browser-name) field as a `browser`. Note that this behaviour will be removed with Vitest 4.
105
98
106
99
Under the hood, Vitest transforms these instances into separate [test projects](/advanced/api/test-project) sharing a single Vite server for better caching performance.
- custom: any string that will be passed to the provider
122
-
123
101
## browser.headless
124
102
125
103
-**Type:**`boolean`
@@ -150,70 +128,86 @@ A path to the HTML entry point. Can be relative to the root of the project. This
150
128
151
129
Configure options for Vite server that serves code in the browser. Does not affect [`test.api`](#api) option. By default, Vitest assigns port `63315` to avoid conflicts with the development server, allowing you to run both in parallel.
Path to a provider that will be used when running browser tests. Vitest provides three providers which are `preview` (default), `webdriverio` and `playwright`. Custom providers should be exported using `default` export and have this shape:
137
+
The return value of the provider factory. You can import the factory from `@vitest/browser/providers/<provider-name>` or make your own provider:
import { playwright } from '@vitest/browser/providers/playwright'
141
+
import { webdriverio } from '@vitest/browser/providers/webdriverio'
142
+
import { preview } from '@vitest/browser/providers/preview'
178
143
179
-
::: danger ADVANCED API
180
-
The custom provider API is highly experimental and can change between patches. If you just need to run tests in a browser, use the [`browser.instances`](#browser-instances) option instead.
To have a better type safety when using built-in providers, you should reference one of these types (for provider that you are using) in your [config file](/config/):
191
+
### Custom Provider
192
+
193
+
::: danger ADVANCED API
194
+
The custom provider API is highly experimental and can change between patches. If you just need to run tests in a browser, use the [`browser.instances`](#browser-instances) option instead.
0 commit comments