react/scripts/jest/config.source-persistent.js
lunaruan b12a982062
Babel 7 (#16297)
Upgraded from Babel 6 to Babel 7.

The only significant change seems to be the way `@babel/plugin-transform-classes` handles classes differently from `babel-plugin-transform-es2015-classes`. In regular mode, the former injects a `_createClass` function that increases the bundle size, and in the latter it removes the safeguard checks. However, this is okay because we don't all classes in new features, and we want to deprecate class usage in the future in the react repo.

Co-authored-by: Luna Ruan <luna@fb.com>
Co-authored-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Co-authored-by: Maksim Markelov <maks-markel@mail.ru>
2019-08-08 17:46:35 -07:00

25 lines
847 B
JavaScript

'use strict';
const baseConfig = require('./config.base');
module.exports = Object.assign({}, baseConfig, {
modulePathIgnorePatterns: [
'ReactIncrementalPerf',
'ReactIncrementalUpdatesMinimalism',
'ReactIncrementalTriangle',
'ReactIncrementalReflection',
'forwardRef',
// ReactFreshBabelPlugin is only available for dev.
// We need two tests here because otherwise, ReactFreshBabelPlugin-test will
// fail due to obsolete snapshots
process.env.NODE_ENV === 'development'
? '<rootDir>/packages/react-refresh/src/__tests__/ReactFreshBabelPluginProd-test.js'
: '<rootDir>/packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js',
],
setupFiles: [
...baseConfig.setupFiles,
require.resolve('./setupTests.persistent.js'),
require.resolve('./setupHostConfigs.js'),
],
});