mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 14:02:44 +08:00
chore: update Jest preset to align with Jest 24 (#24062)
Summary:
Jest 24 includes [`testMatch` and `moduleFileExtensions`](c5fd7aae93/packages/jest-config/src/Defaults.ts (L70)) that align with the ones that are currently there on master, because it added default handling for TypeScript as well. I think it's time for us to move to Jest 24. Is there a way we can tell users to upgrade Jest to certain version?
Fixes https://github.com/facebook/react-native/issues/24060
[General] [Changed] - update Jest preset to align with Jest 24
Pull Request resolved: https://github.com/facebook/react-native/pull/24062
Differential Revision: D14538988
Pulled By: cpojer
fbshipit-source-id: d8d152b8e8517b34144970f1cc1ed0b49f8b4e54
This commit is contained in:
committed by
Facebook Github Bot
parent
5dd6908b25
commit
23ef604d41
@@ -18,7 +18,6 @@ module.exports = {
|
|||||||
hasteImplModulePath: require.resolve('./jest/hasteImpl.js'),
|
hasteImplModulePath: require.resolve('./jest/hasteImpl.js'),
|
||||||
providesModuleNodeModules: ['react-native'],
|
providesModuleNodeModules: ['react-native'],
|
||||||
},
|
},
|
||||||
moduleFileExtensions: ['js', 'json', 'jsx', 'node', 'ts', 'tsx'],
|
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'^React$': require.resolve('react'),
|
'^React$': require.resolve('react'),
|
||||||
},
|
},
|
||||||
@@ -30,10 +29,6 @@ module.exports = {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
transformIgnorePatterns: ['node_modules/(?!(jest-)?react-native)'],
|
transformIgnorePatterns: ['node_modules/(?!(jest-)?react-native)'],
|
||||||
testMatch: [
|
|
||||||
'**/__tests__/**/*.(js|ts|tsx)',
|
|
||||||
'**/?(*.)+(spec|test).(js|ts|tsx)',
|
|
||||||
],
|
|
||||||
setupFiles: [require.resolve('./jest/setup.js')],
|
setupFiles: [require.resolve('./jest/setup.js')],
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user