Skip to content
masterclass Buddy

Vitest · Function

it

test defines a named test case and runs its expectations. It can also control timeout and test behavior through options or chained helpers.

Last updated

Syntax

function test(name: string | Function, body?: () => unknown, timeout?: number): void
function test(name: string | Function, options: TestOptions, body?: () => unknown): void

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

Subscribe
  • it
  • test.skip
  • test.only
  • test.todo
  • test.concurrent
  • test.fails
  • test.each
  • test.skipIf

Source: Test | Vitest. Checked 2026-11-03.