Skip to content
masterclass Buddy

Vitest · Pipe

test.globals

Vitest defines tests with test or it and checks results with expect. Test files are isolated and run in parallel by default; tests in one file run sequentially.

Last updated

Syntax

test(name: string, fn: () => void)
it(name: string, fn: () => void)
vi.mock(path: string, factory?: MockOptions | MockFactory): void

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • test
  • it
  • expect
  • test.concurrent
  • test.for
  • vi.mock
  • vi.hoisted
  • vi.resetModules

Source: Writing Tests | Guide | Vitest. Checked 2026-11-03.