Files
react-native/jest/preprocessor.js
T
Moti Zilberman c1e9aa9a27 Deprecate jest/preprocessor.js
Summary:
Changelog:
[General][Deprecated] Deprecate the use of `react-native/jest/preprocessor.js` by external projects

The supported method of using Jest in React Native projects is using the [Jest preset](https://jestjs.io/docs/tutorial-react-native) shipped as part of the `react-native` package. Some projects are directly using `preprocessor.js` which is part of the testing setup for the React Native repo itself.

In a future release of React Native, we will stop publishing this file to npm and require projects to switch to the supported preset (or a custom Jest config if necessary).

Reviewed By: GijsWeterings

Differential Revision: D34820086

fbshipit-source-id: 197c33726639e66c6916a244117252e6af11f2f6
2022-03-14 07:40:05 -07:00

41 lines
1001 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
/* eslint-env node */
'use strict';
// NOTE: Avoiding using a package like 'chalk' here, for simplicity
const YELLOW = process.stderr.isTTY ? '\u001b[33m' : '';
const BOLD = process.stderr.isTTY ? '\u001b[1m' : '';
const RESET = process.stderr.isTTY ? '\u001b[0m' : '';
const UNDERLINE = process.stderr.isTTY ? '\u001b[4m' : '';
console.warn(
'\n' +
YELLOW +
BOLD +
'react-native/jest/preprocessor.js' +
RESET +
YELLOW +
' is deprecated and will be removed.\n' +
'Use "preset": "react-native" in your Jest config instead.\n' +
'See ' +
UNDERLINE +
'https://jestjs.io/docs/tutorial-react-native' +
RESET +
YELLOW +
' for more setup instructions.' +
RESET +
'\n',
);
module.exports = require('./preprocessor_DO_NOT_USE');