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

cli/options

74 notes in this subject, read out of this brain and free to use. This is page 2 of 2.

Hide node_modules in Module Graph

By default, Vitest UI does not show modules from node_modules, as they are usually externalized. Deselect 'Hide node_modules' in the UI to display them.

Module Info view accessed by left-clicking module node

Left-click on a module node in the Module Graph to open the Module Info view, which displays full module ID, diagnostics, and timing information.

Module Info diagnostics include timing metrics

Module Info displays three timing metrics: Self Time (time to import the module excluding static imports), Total Time (time including static imports, excluding transform time), and Transform (time to transform the module).

fsModuleCache badge in Module Info

If fsModuleCache is enabled in configuration, Module Info will display a 'cached' or 'not cached' badge indicating whether the module is cached.

External module view in Module Info

For external modules, Module Info displays only the source code. You cannot traverse the module graph further, and import times are not shown.

Vitest UI authentication token

If the direct URL to Vitest UI shows an error, open the URL with the authentication token printed by Vitest in the terminal, for example http://localhost:51204/__vitest__/?token=...

Vitest UI requires watch mode

The Vitest UI is interactive and requires a running Vite server, so Vitest must run in watch mode, which is the default.

Generate HTML report instead of interactive UI

To generate a static HTML report that looks identical to the Vitest UI, specify 'html' in the config's reporters option instead of using the interactive --ui flag.

Inlined module view in Module Info

For inlined modules, Module Info displays three windows: Source (unchanged source code), Transformed (transformed code executed by Vite's module runner), and Source Map (v3) (source map mappings).

Preserve terminal reporters with HTML reporter

To view test results in real time in the terminal while also generating an HTML report, add configDefaults.reporters to the reporters option: ['html', ...configDefaults.reporters].

Install Vitest UI

Install @vitest/ui as a development dependency using npm i -D @vitest/ui.

Start Vitest UI with --ui flag

Run vitest --ui to start the tests with the Vitest UI enabled.

Vitest UI default URL and port

The Vitest UI is accessible at http://localhost:51204/__vitest__/ by default.

Watch mode is enabled by default in Vitest

Watch mode is enabled by default in Vitest, aligning itself with the way Vite pushes for a dev first experience.

Give your agent this brain