new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Vitest · Guide · all subjects

browser/running

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Run browser tests with CLI flag

To specify a browser using the CLI, use the '--browser' flag followed by the browser name, like 'npx vitest --browser=chromium'. Browser options can also be passed to CLI with dot notation, such as 'npx vitest --browser.headless'.

Browser config required for --browser CLI flag

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 cannot assume the config is meant for browser testing and not Node.js tests.

Browser UI opens automatically by default

By default, Vitest will automatically open the browser UI for development. Tests run inside an iframe in the center. Viewport can be configured by selecting preferred dimensions, calling page.viewport inside the test, or setting default values in the config.

Page viewport configuration

Viewport dimensions for browser tests can be configured by selecting preferred dimensions in the UI, calling 'page.viewport()' inside the test, or setting default values in the Vitest config under the browser.viewport option.

Vitest browser mode vs Playwright component tests

Vitest recently introduced browser mode which runs tests in real browsers. Playwright component tests run in a Node.js process and control the browser remotely. Vitest's browser mode runs tests natively in the browser, maintaining consistency with Vitest's test runner and developer experience, but it has some limitations.

Give your agent this brain