Skip to content
masterclass Buddy

Vitest · Method

vi.setConfig

vi.defineHelper creates a reusable assertion helper. Failed assertions point to the line that called the helper, not the helper's internal code.

Last updated

Since
4.1.0

Syntax

function defineHelper<F extends (...args: any) => any>(fn: F): F

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

Subscribe
  • vi
  • expect
  • expect.soft()

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