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

explore / Web & frontend / mozg / Vitest

Vitest · Guide

Answer questions from the Vitest guide: writing and running tests, mocking functions, modules and timers with vi, snapshot testing, coverage, browser mode, workspaces, test context and the CLI commands with their flags.

1,607 notes · updated 2026-08-15 · trained 84%

since last sitting: +52 newly passed — this brain is learning · the verified changelog →

use this brain
# sign in to get a token
$ claude mcp add --transport http mozg \
https://mozg.sh/mcp --header "Authorization: Bearer …"
> use mozg/vitest-guide — …
Sign in — get this command with your token in it

New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.

Or just add it

Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.

Sign in to add it

Ask it things like

answers 51/60 on its latest exam · anti-bluff 1/1
What are the three browser providers available in Vitest?Browser Mode
What are the main Vitest hooks and what is their execution order in a describe block?Hooks & Setup/Teardown
What is the correct way to mock an async function in Vitest?Mocking Functions & Modules
How do you write a basic test in Vitest and what function does it start with?Writing Tests & Running
How do you enable browser mode in Vitest configuration?Browser Mode
What does the maxConcurrency flag control?Concurrency & Parallelization
What are the two coverage providers available in Vitest?Coverage & Reporting
Where must vi.mock, vi.unmock, and vi.hoisted be placed in a test file?Mocking Functions & Modules

What it can answer

60 coverage checks
84%
Answers 52 of the exam's 61 questionsIt answers 52 questions, 52 more than last time, out of an exam that grew by 61.Nothing it used to answer has stopped working.
Snapshot Testing6 / 6
Browser Mode5 / 7
CLI Commands & Flags5 / 6
Concurrency & Parallelization5 / 5
Mocking Functions & Modules5 / 6
Writing Tests & Running5 / 6
Coverage & Reporting4 / 4
Hooks & Setup/Teardown4 / 4
Benchmarking3 / 5
Test Context & Advanced3 / 5
Timers & Fake Time3 / 3
Workspaces & Projects3 / 3
exam badge — share this score →

Attacks survived

re-run weekly · 2026-08-09
gate-battery12/12 known hostile payloads caught by the ingest gate
injection-corpusevery active note scanned — no steering language
secret-corpusevery active note scanned — no keys or credentials

heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability

Inside

  • TestProject.vite property · advanced/projects
  • TestProject.isRootProject() method · advanced/projects
  • TestProject.serializedConfig property · advanced/projects
  • TestProject.hash property · advanced/projects
  • TestProject.provide() method · test context & advanced
  • TestProject.createSpecification() method · advanced/projects
  • TestProject name resolution · advanced/projects
  • TestProject.vitest property · advanced/projects
  • TestProject.globalConfig property · advanced/projects
  • TestProject.config property · advanced/projects
  • TestProject.sharedViteServer property · advanced/projects
  • TestProject.browser property · browser/configuration
  • TestProject.getProvidedContext() method · test context & advanced
  • TestProject.globTestFiles() method · advanced/projects

Licence

CC BY-NC-SA 4.0

Use it, copy it, build on it, with credit. Selling it is not allowed.