12345678910111213141516171819202122232425262728293031323334353637 |
- // @remove-on-eject-begin
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
- // @remove-on-eject-end
- 'use strict';
- const babelJest = require('babel-jest');
- const hasJsxRuntime = (() => {
- if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
- return false;
- }
- try {
- require.resolve('react/jsx-runtime');
- return true;
- } catch (e) {
- return false;
- }
- })();
- module.exports = babelJest.createTransformer({
- presets: [
- [
- require.resolve('babel-preset-react-app'),
- {
- runtime: hasJsxRuntime ? 'automatic' : 'classic',
- },
- ],
- ],
- babelrc: false,
- configFile: false,
- });
|