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 mode

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

browser.enabled CLI flag

The browser.enabled CLI flag is `--browser.enabled` and runs tests in the browser. Equivalent to `--browser.enabled`. Default is `false`.

browser.name CLI flag

The browser.name CLI flag is `--browser.name <name>` and runs all tests in a specific browser. Some browsers are only available for specific providers.

browser.headless CLI flag

The browser.headless CLI flag is `--browser.headless` and runs the browser in headless mode without opening the GUI. If running in CI, it will be enabled by default. Default is `process.env.CI`.

browser.ui CLI flag

The browser.ui CLI flag is `--browser.ui` and shows Vitest UI when running tests. Default is `!process.env.CI`.

browser.detailsPanelPosition CLI flag

The browser.detailsPanelPosition CLI flag is `--browser.detailsPanelPosition <position>` and sets the default position for the details panel in browser mode. Either `right` (horizontal split) or `bottom` (vertical split). Default is `right`.

browser.connectTimeout CLI flag

The browser.connectTimeout CLI flag is `--browser.connectTimeout <timeout>` and sets the timeout for browser connection. If connection takes longer, the test suite will fail. Default is `60_000` milliseconds.

browser.dependencySourcemaps CLI flag

The browser.dependencySourcemaps CLI flag is `--browser.dependencySourcemaps` and serves sourcemaps of dependencies to the browser in headless runs, used by devtools when debugging into `node_modules`. Reported test errors are source-mapped either way. Use `--browser.dependencySourcemaps=false` to speed up test runs. Default is `true`.

browser.trackUnhandledErrors CLI flag

The browser.trackUnhandledErrors CLI flag is `--browser.trackUnhandledErrors` and controls if Vitest catches uncaught exceptions so they can be reported. Default is `true`.

browser.trace CLI flag

The browser.trace CLI flag is `--browser.trace <mode>` and enables trace view mode. Supported modes are: "on", "off", "on-first-retry", "on-all-retries", "retain-on-failure".

browser.traceView.enabled CLI flag

The browser.traceView.enabled CLI flag is `--browser.traceView.enabled` and enables Vitest trace-view collection for browser tests. Default is `false`.

browser.traceView.recordCanvas CLI flag

The browser.traceView.recordCanvas CLI flag is `--browser.traceView.recordCanvas` and captures canvas pixels in trace-view snapshots. Default is `false`.

browser.traceView.inlineImages CLI flag

The browser.traceView.inlineImages CLI flag is `--browser.traceView.inlineImages` and inlines loaded image pixels in trace-view snapshots. Default is `false`.

browser.locators.exact CLI flag

The browser.locators.exact CLI flag is `--browser.locators.exact` and determines whether locators should match the text exactly by default. Default is `true`.

Automocked modules no longer call real implementation in browser mode

In Vitest 5.0 browser mode, the exports of an automocked module (a vi.mock call with no factory) now return undefined by default instead of calling the real implementation. Pass { spy: true } to keep calling the real implementation while still tracking calls, or provide a factory with the behavior you need.

Vitest UI requires authenticated URL

In Vitest 5.0, Vitest UI requires token authentication for the HTML page and API access. The /__vitest__/ URL will show an error until the browser is authenticated. To authenticate, open the URL with a token printed by Vitest (e.g., http://localhost:51204/__vitest__/?token=...).

Browser orchestrator URL requires a session

In Vitest 5.0, the browser orchestrator is no longer served from a bare /__vitest_test__/ URL. Browser runner URLs are now session-bound and must include the sessionId generated by Vitest (e.g., /__vitest_test__/?sessionId=...).

Give your agent this brain