Skip to content
masterclass Buddy

Jest · Pipe

testEnvironment

Jest chooses where tests run. Node is the default; jsdom supplies browser APIs. Configure one environment for the project or select one file with a docblock.

Last updated

Syntax

testEnvironment: 'node' | 'jsdom' | '<environment-path>'
testEnvironmentOptions: {}
/** @jest-environment <environment-name> */

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

Subscribe
  • testEnvironment
  • testEnvironmentOptions
  • NodeEnvironment
  • JSDOMEnvironment
  • @jest/environment-jsdom-abstract
  • context.docblockPragmas
  • handleTestEvent

Source: Test Environment · Jest. Checked 2026-11-03.