mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 14:48:25 +00:00
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
35 lines
927 B
JavaScript
35 lines
927 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const dir = __dirname;
|
|
|
|
module.exports = {
|
|
haste: {
|
|
defaultPlatform: 'ios',
|
|
platforms: ['android', 'ios', 'native'],
|
|
hasteImplModulePath: require.resolve('./jest/hasteImpl.js'),
|
|
providesModuleNodeModules: ['react-native'],
|
|
},
|
|
moduleNameMapper: {
|
|
'^React$': require.resolve('react'),
|
|
},
|
|
modulePathIgnorePatterns: [`${dir}/Libraries/react-native/`],
|
|
transform: {
|
|
'^.+\\.(js|ts|tsx)$': 'babel-jest',
|
|
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
|
|
'./jest/assetFileTransformer.js',
|
|
),
|
|
},
|
|
transformIgnorePatterns: ['node_modules/(?!(jest-)?react-native)'],
|
|
setupFiles: [require.resolve('./jest/setup.js')],
|
|
testEnvironment: 'node',
|
|
};
|