mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-23 12:48:00 +08:00
Cleanup Jest config (#6654)
General cleanup after the [Jest 24 PR](#6278).
This also includes `jsdom@14` via https://www.npmjs.com/package/jest-environment-jsdom-fourteen. Since we have a node >= 8.10 requirement, we are able to use the latest version of `jsdom` which includes additional implementations of browser APIs such as `MutationObserver` (which we had an issue filed for over at #6617).
/cc @SimenB. Is there more you recommend we do to cleanup our [Jest config](b0cbf2caa1/packages/react-scripts/scripts/utils/createJestConfig.js) for TypeScript?
Co-authored-by: Ian Sutherland <ian@iansutherland.ca>
This commit is contained in:
committed by
Ian Sutherland
parent
e630238d0d
commit
76fea02277
@@ -35,8 +35,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
|
||||
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
|
||||
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}',
|
||||
],
|
||||
testEnvironment: 'jsdom',
|
||||
testURL: 'http://localhost',
|
||||
testEnvironment: 'jest-environment-jsdom-fourteen',
|
||||
transform: {
|
||||
'^.+\\.(js|jsx|ts|tsx)$': isEjecting
|
||||
? '<rootDir>/node_modules/babel-jest'
|
||||
@@ -58,8 +57,8 @@ module.exports = (resolve, rootDir, isEjecting) => {
|
||||
ext => !ext.includes('mjs')
|
||||
),
|
||||
watchPlugins: [
|
||||
require.resolve('jest-watch-typeahead/filename'),
|
||||
require.resolve('jest-watch-typeahead/testname'),
|
||||
'jest-watch-typeahead/filename',
|
||||
'jest-watch-typeahead/testname',
|
||||
],
|
||||
};
|
||||
if (rootDir) {
|
||||
|
||||
Reference in New Issue
Block a user