Skip to content

Commit

Permalink
fix: always resolve "jest-environment-jsdom" from jest-config
Browse files Browse the repository at this point in the history
Closes #7064
  • Loading branch information
aleclarson committed Dec 6, 2018
1 parent 6a2237d commit a161ea5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a161ea5

Please sign in to comment.