New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@vitest/browser-preview

Package Overview
Dependencies
Maintainers
5
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/browser-preview

Browser running for Vitest using your browser of choice

beta
Source
npmnpm
Version
4.1.0-beta.6
Version published
Weekly downloads
35K
20.63%
Maintainers
5
Weekly downloads
 
Created
Source

@vitest/browser-preview

NPM version

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:

Installation

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-preview

Then 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 --browser

If browser didn't open automatically, follow the link in the terminal to open the browser preview.

GitHub | Documentation

Keywords

browser

FAQs

Package last updated on 05 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts