diff --git a/CHANGELOG.md b/CHANGELOG.md index 1953f9889dd0..6b33ff22797d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - `[jest-config]` Add `haste.computeSha1` option to compute the sha-1 of the files in the haste map ([#7345](https://github.com/facebook/jest/pull/7345)) - `[expect]` `expect(Infinity).toBeCloseTo(Infinity)` Treats `Infinity` as equal in toBeCloseTo matcher ([#7405](https://github.com/facebook/jest/pull/7405)) - `[jest-worker]` Add node worker-thread support to jest-worker ([#7408](https://github.com/facebook/jest/pull/7408)) +- `[jest-config]` Always resolve jest-environment-jsdom from jest-config ([#7476](https://github.com/facebook/jest/pull/7476)) ### Fixes diff --git a/packages/jest-config/src/normalize.js b/packages/jest-config/src/normalize.js index b29e3e690091..1d7a22b6752f 100644 --- a/packages/jest-config/src/normalize.js +++ b/packages/jest-config/src/normalize.js @@ -401,12 +401,10 @@ export default function normalize(options: InitialOptions, argv: Argv) { options = setupPreset(options, options.preset); } - if (options.testEnvironment) { - options.testEnvironment = getTestEnvironment({ - rootDir: options.rootDir, - testEnvironment: options.testEnvironment, - }); - } + options.testEnvironment = getTestEnvironment({ + rootDir: options.rootDir, + testEnvironment: options.testEnvironment || 'jsdom', + }); if (!options.roots && options.testPathDirs) { options.roots = options.testPathDirs;