-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Jest): support overriding config #2197
Conversation
@@ -18,10 +19,7 @@ export default class ReactScriptsTSJestConfigLoader implements JestConfigLoader | |||
|
|||
// Create the React configuration for Jest | |||
const jestConfiguration = this.createJestConfig(reactScriptsTsLocation); | |||
|
|||
// Set test environment to jsdom (otherwise Jest won't run) | |||
jestConfiguration.testEnvironment = 'jsdom'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simondel this made the test succeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it turns out react-scripts
does use 'jsdom'
as a default (facebook/create-react-app#5074) but react-scripts-ts
was forked before that change was made and it hasn't really been updated for two years...
jest.configFile
to specify a path to your config file. This file will be loaded usingrequire
jest.config
setting now works together withjest.configFile
to allow you to override the config in yourconfigFile
Fixes #2155