[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

docs: update the browser CLI option

Vladimir Sheremet (May 19, 2025, 6:04 PM +0200) edc0b4a1 703581b6

+6 -2
+6 -2
docs/guide/browser/index.md
··· 95 95 96 96 ## Configuration 97 97 98 - To activate browser mode in your Vitest configuration, you can use the `--browser=name` flag or set the `browser.enabled` field to `true` in your Vitest configuration file. Here is an example configuration using the browser field: 98 + To activate browser mode in your Vitest configuration, set the `browser.enabled` field to `true` in your Vitest configuration file. Here is an example configuration using the browser field: 99 99 100 100 ```ts [vitest.config.ts] 101 101 import { defineConfig } from 'vitest/config' ··· 327 327 To specify a browser using the CLI, use the `--browser` flag followed by the browser name, like this: 328 328 329 329 ```sh 330 - npx vitest --browser=chrome 330 + npx vitest --browser=chromium 331 331 ``` 332 332 333 333 Or you can provide browser options to CLI with dot notation: ··· 335 335 ```sh 336 336 npx vitest --browser.headless 337 337 ``` 338 + 339 + ::: warning 340 + Since Vitest 3.2, if you don't have the `browser` option in your config but specify the `--browser` flag, Vitest will fail because it can't assume that config is meant for the browser and not Node.js tests. 341 + ::: 338 342 339 343 By default, Vitest will automatically open the browser UI for development. Your tests will run inside an iframe in the center. You can configure the viewport by selecting the preferred dimensions, calling `page.viewport` inside the test, or setting default values in [the config](/config/#browser-viewport). 340 344