Skip to content
masterclass Buddy

Vitest · Function

suite

test defines a Vitest test case from a name and a function of expectations. It supports options such as timeouts, retries, skipping, expected failures, repetition, and concurrency.

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.fails
  • test.concurrent
  • test.extend
  • test.runIf

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