Skip to content
masterclass Buddy

Jest · Pipe

setupFiles

Jest's setupFilesAfterEnv option runs setup modules before each test file, after the testing framework is installed. Use it for shared matchers, Jest APIs, and test hooks.

Last updated

Syntax

setupFilesAfterEnv: string[]

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

Subscribe
  • setupFiles
  • <rootDir>
  • expect
  • jest
  • afterEach
  • testEnvironment

Source: Configuring Jest · Jest. Checked 2026-11-03.