Skip to content
masterclass Buddy

Vitest · Pipe

test.setupFiles

test.setupFiles points to files that Vitest runs before each test file. Use it for shared setup such as polyfills, global configuration, custom matchers, and hooks.

Last updated

Syntax

test: { setupFiles: string | string[] }

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

Subscribe
  • sequence.setupFiles
  • globalSetup
  • beforeEach
  • afterEach
  • Test Run Lifecycle

Source: setupFiles | Config | Vitest. Checked 2026-11-03.