Skip to content
masterclass Buddy

Vitest · Function

test.runIf

test.runIf(condition) runs a test when the condition is truthy and skips it otherwise. It is the opposite of test.skipIf.

Last updated

Syntax

test.runIf(condition)(name, body?, timeout?)

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

Subscribe
  • test
  • test.skipIf
  • describe.runIf
  • it.runIf

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