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 · Config reference · all subjects

config/api

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.

attachmentsDir configuration option

The attachmentsDir option is a string type configuration that specifies the directory path for storing file attachments created by context.annotate. Its default value is '.vitest/attachments'. This option is resolved relative to the root Vitest config, and when using projects, all projects share the same attachmentsDir; it cannot be configured per project.

api option type and default

The api option has type boolean | number | object with a default value of false. The CLI flags are --api, --api.port, --api.host, and --api.strictPort. When set to true, the default port is 51204 or 63315 if running in Browser Mode.

api.allowWrite type and default

The api.allowWrite option has type boolean. The default value is true if not exposed to the network, and false otherwise. Vitest server can save test files or snapshot files via the API. In Browser Mode, Vitest saves annotation attachments, artifacts, and snapshots via a WebSocket connection from the browser. This option also gates privileged browser APIs that can write files indirectly, such as raw Chrome DevTools Protocol access through cdp().

api.allowExec type and default

The api.allowExec option has type boolean. The default value is true if not exposed to the network, and false otherwise. This option allows running any test file via the UI and applies to interactive elements in the UI that can run code. In Browser Mode, this option also gates indirect code execution, including evaluating external .snap files on the server and accessing raw Chrome DevTools Protocol through cdp().

api security: default host and network exposure

Vitest does not expose the API to the internet by default and only listens on localhost. If the host is set to anything other than localhost or 127.0.0.1, Vitest will set api.allowWrite and api.allowExec to false by default.

Give your agent this brain