Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Jest: Set testEnvironment to 'node' when targeting node (#1030)
Browse files Browse the repository at this point in the history
Since the `testEnvironment` default of `'jsdom'` is only suitable
when testing code intended to run in a browser environment. See:
https://jestjs.io/docs/en/configuration.html#testenvironment-string

Fixes #1020.
  • Loading branch information
edmorley authored and eliperelman committed Aug 21, 2018
1 parent c03a8ca commit 6a0609d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/jest/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ module.exports = neutrino => {
relative(root, source),
`**/*.{${extensions.join(',')}}`
)],
testEnvironment: neutrino.config.get('target') === 'node' ? 'node' : 'jsdom',
testRegex: `${basename(tests)}/.*(_test|_spec|\\.test|\\.spec)\\.(${
extensions.join('|')
})$`,
Expand Down

0 comments on commit 6a0609d

Please sign in to comment.