Function: browserConfig()
Documentation / @wtf/project-vitest / browser / browserConfig
function browserConfig(__namedParameters?): Promise<UserConfig>;Defined in: packages/project-vitest/src/browser.ts:83
The Vitest config of one package’s tests of the browser, its vitest.browser.config.ts: each
*.browser.test.ts or *.browser.test.tsx of test/, in a headless Chromium by Playwright, with
no screenshot of a failure, as a test of the browser asserts what the platform does and not what
it draws. JSX by React’s automatic runtime, so a .tsx test imports no React; 30 seconds a test;
and the reports the CI reads, the same alone as in the root’s run: in CI the dots and a JUnit
report, reports/browser-results.xml of the package, where the root’s run writes the one of
every package, its browser-results.xml, with its coverage.
The workspace’s packages resolve as the unit suite’s do (see packageConfig): to their source by
vite’s aliases, or, with TEST_FROM=dist, to their build. With no setup file: the resolve hook
of Node, which packageConfig registers in a worker, has no place in a browser.
A package gives only what is its own: its name, the files it tests if not those, its plugins
and aliases, its setupFiles, and any option of its tests over the config’s, its browser
over the config’s one option at a time.
export default browserConfig({ name: 'elements:browser' })Parameters
| Parameter | Type |
|---|---|
__namedParameters | BrowserOptions |
Returns
Promise<UserConfig>
