From 8433c5cbcbf139d5174bf254996f9f02297a97c5 Mon Sep 17 00:00:00 2001 From: Nico Jansen Date: Fri, 6 May 2022 11:38:47 +0200 Subject: [PATCH] docs(upgrading): detail changes to NodeEnvironment export (#12812) --- docs/UpgradingToJest28.md | 10 ++++++++++ .../versioned_docs/version-28.0/UpgradingToJest28.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/docs/UpgradingToJest28.md b/docs/UpgradingToJest28.md index df64e6a475a9..485cc51d9d31 100644 --- a/docs/UpgradingToJest28.md +++ b/docs/UpgradingToJest28.md @@ -140,6 +140,16 @@ The constructor of [test environment](Configuration.md#testenvironment-string) c + const config = projectConfig; ``` +In addition, test environments are now exported with the name `TestEnvironment`, instead of simply exporting the class directly: + +```diff +- const TestEnvironment = require('jest-environment-node'); ++ const {TestEnvironment} = require('jest-environment-node'); + +- const TestEnvironment = require('jest-environment-jsdom'); ++ const {TestEnvironment} = require('jest-environment-jsdom'); +``` + ### `jsdom` If you are using JSDOM [test environment](Configuration.md#testenvironment-string), `jest-environment-jsdom` package now must be installed separately: diff --git a/website/versioned_docs/version-28.0/UpgradingToJest28.md b/website/versioned_docs/version-28.0/UpgradingToJest28.md index 0ab7f4a03878..3e2eee4a9a5d 100644 --- a/website/versioned_docs/version-28.0/UpgradingToJest28.md +++ b/website/versioned_docs/version-28.0/UpgradingToJest28.md @@ -140,6 +140,16 @@ The constructor of [test environment](Configuration.md#testenvironment-string) c + const config = projectConfig; ``` +In addition, test environments are now exported with the name `TestEnvironment`, instead of simply exporting the class directly: + +```diff +- const TestEnvironment = require('jest-environment-node'); ++ const {TestEnvironment} = require('jest-environment-node'); + +- const TestEnvironment = require('jest-environment-jsdom'); ++ const {TestEnvironment} = require('jest-environment-jsdom'); +``` + ### `jsdom` If you are using JSDOM [test environment](Configuration.md#testenvironment-string), `jest-environment-jsdom` package now must be installed separately: