package
Browser running for Vitest using your browser of choice
npm install @vitest/browser-previewGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
See how your tests look like in a real browser. For proper and stable browser testing, we recommend running tests in a headless browser in your CI instead. For this, you should use either:
Install the package with your favorite package manager:
npm install -D @vitest/browser-preview
# or
yarn add -D @vitest/browser-preview
# or
pnpm add -D @vitest/browser-previewThen specify it in the browser.provider field of your Vitest configuration:
// vitest.config.ts
import { defineConfig } from 'vitest/config'
import { preview } from '@vitest/browser-preview'
export default defineConfig({
test: {
browser: {
provider: preview(),
instances: [
{ browser: 'chromium' },
],
},
},
})Then run Vitest in the browser mode:
npx vitest --browserIf browser didn't open automatically, follow the link in the terminal to open the browser preview.
Latest published Nov 2, 2026
antfu
anthonyfu117@hotmail.com
Estimated unpacked size across 37 packages.
7.8 MB
Includes dependencies.
3 direct dependencies.