Skip to content

Commit

Permalink
Stop publishing jest/preprocessor.js to npm
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Breaking][General] Remove jest/preprocessor from the react-native package

Using `react-native/jest/preprocessor` outside of the React Native repo has been deprecated since D34820086 (c1e9aa9). Here, we make this file private and stop publishing it to npm.

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.

NOTE: We could probably make some of the other files under `jest/` private as well, but we should go through a separate deprecation cycle with those, in case they are also being used externally by some projects. I'm leaving that for future followup at the moment.

Reviewed By: GijsWeterings

Differential Revision: D36132939

fbshipit-source-id: 300ffa6cf16232573cd3a79a34c14daaafd7aa43
  • Loading branch information
motiz88 authored and facebook-github-bot committed May 6, 2022
1 parent 9d3d5e1 commit 0301cb2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
transform: {
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$':
'<rootDir>/jest/assetFileTransformer.js',
'.*': './jest/preprocessor_DO_NOT_USE.js',

This comment has been minimized.

Copy link
@madhus1025

madhus1025 Jun 14, 2023

Could you help us understand the reason behind removing preprocessor.js file ? or share any link for us to go through

'.*': './jest/private/preprocessor.js',
},
setupFiles: ['./jest/setup.js'],
timers: 'fake',
Expand Down
40 changes: 0 additions & 40 deletions jest/preprocessor.js

This file was deleted.

File renamed without changes.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"outputName": "js-test-results.xml"
},
"files": [
"!template/node_modules",
"!template/package-lock.json",
"!template/yarn.lock",
"android",
"cli.js",
"flow",
Expand All @@ -25,6 +22,7 @@
"interface.js",
"jest-preset.js",
"jest",
"!jest/private",
"Libraries",
"LICENSE",
"local-cli",
Expand Down Expand Up @@ -60,6 +58,9 @@
"sdks/hermes-engine.podspec",
"template.config.js",
"template",
"!template/node_modules",
"!template/package-lock.json",
"!template/yarn.lock",
"third-party-podspecs"
],
"scripts": {
Expand Down

0 comments on commit 0301cb2

Please sign in to comment.