From 473eb1dd870a4f62c4ebcba27e12bde1e99e3d07 Mon Sep 17 00:00:00 2001 From: Adnan Bacic Date: Wed, 18 Jan 2023 02:00:19 -0800 Subject: [PATCH] Move jest config from package.json to dedicated jest.config.js file (#35856) Summary: According to: https://jestjs.io/docs/configuration > It is recommended to define the configuration in a dedicated JavaScript, TypeScript or JSON file. The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json. react-native projects have the jest config in package.json, this change aims to follow jest recommendations and have a dedicated file for jest configs. Originally suggested here: https://github.com/react-native-community/discussions-and-proposals/discussions/583 ## Changelog [GENERAL] [CHANGED] - Moved jest config from package.json to dedicated jest.config.js file Pull Request resolved: https://github.com/facebook/react-native/pull/35856 Test Plan: 1. cd template 2. yarn 3. yarn test The test should (still) pass Reviewed By: christophpurrer Differential Revision: D42544351 Pulled By: robhogan fbshipit-source-id: e27d1dad2b52d757777c40a77d0639f381557c88 --- template/jest.config.js | 3 +++ template/package.json | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 template/jest.config.js diff --git a/template/jest.config.js b/template/jest.config.js new file mode 100644 index 0000000000..8eb675e9bc --- /dev/null +++ b/template/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + preset: 'react-native', +}; diff --git a/template/package.json b/template/package.json index 0ebe7e60b4..3ac504d528 100644 --- a/template/package.json +++ b/template/package.json @@ -29,8 +29,5 @@ "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" - }, - "jest": { - "preset": "react-native" } }