From 14fd38434ff3bf3b5e50eba8f14b3cf93ff1f84b Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Thu, 25 Mar 2021 16:05:58 -0400 Subject: [PATCH 01/10] Upgrade jest from 26.6.0 to 27.0.0-next.6 --- package.json | 2 +- packages/babel-plugin-named-asset-import/package.json | 2 +- packages/confusing-browser-globals/package.json | 2 +- packages/create-react-app/package.json | 2 +- packages/react-dev-utils/package.json | 2 +- packages/react-error-overlay/package.json | 2 +- packages/react-scripts/fixtures/kitchensink/template.json | 2 +- packages/react-scripts/package.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a5c093bf32..03849d3764 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "get-port": "^5.1.1", "globby": "^11.0.1", "husky": "^4.3.0", - "jest": "26.6.0", + "jest": "27.0.0-next.6", "lerna": "3.22.1", "lerna-changelog": "~0.8.2", "lint-staged": "^10.4.2", diff --git a/packages/babel-plugin-named-asset-import/package.json b/packages/babel-plugin-named-asset-import/package.json index e80440a08b..da7bc7cceb 100644 --- a/packages/babel-plugin-named-asset-import/package.json +++ b/packages/babel-plugin-named-asset-import/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "babel-plugin-tester": "^8.0.1", - "jest": "26.6.0" + "jest": "27.0.0-next.6" }, "scripts": { "test": "jest" diff --git a/packages/confusing-browser-globals/package.json b/packages/confusing-browser-globals/package.json index d6abc2dc6e..675743bdf4 100644 --- a/packages/confusing-browser-globals/package.json +++ b/packages/confusing-browser-globals/package.json @@ -20,6 +20,6 @@ "index.js" ], "devDependencies": { - "jest": "26.6.0" + "jest": "27.0.0-next.6" } } diff --git a/packages/create-react-app/package.json b/packages/create-react-app/package.json index b83da7dfe0..94175ba53c 100644 --- a/packages/create-react-app/package.json +++ b/packages/create-react-app/package.json @@ -43,6 +43,6 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "26.6.0" + "jest": "27.0.0-next.6" } } diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index 4eb557d20d..c0eaaba274 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -79,7 +79,7 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "26.6.0" + "jest": "27.0.0-next.6" }, "scripts": { "test": "cross-env FORCE_COLOR=true jest" diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index 50f547915f..07fc3300a2 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -55,7 +55,7 @@ "eslint-plugin-testing-library": "^3.9.2", "flow-bin": "^0.116.0", "html-entities": "1.3.1", - "jest": "26.6.0", + "jest": "27.0.0-next.6", "jest-fetch-mock": "2.1.2", "object-assign": "4.1.1", "promise": "8.1.0", diff --git a/packages/react-scripts/fixtures/kitchensink/template.json b/packages/react-scripts/fixtures/kitchensink/template.json index c859e7a14c..06cb69416f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template.json +++ b/packages/react-scripts/fixtures/kitchensink/template.json @@ -2,7 +2,7 @@ "package": { "dependencies": { "bootstrap": "4.3.1", - "jest": "26.6.0", + "jest": "27.0.0-next.6", "node-sass": "4.x", "normalize.css": "7.0.0", "prop-types": "15.7.2", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index b630e887db..a94b9e9429 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -58,7 +58,7 @@ "fs-extra": "^9.0.1", "html-webpack-plugin": "4.5.0", "identity-obj-proxy": "3.0.0", - "jest": "26.6.0", + "jest": "27.0.0-next.6", "jest-circus": "26.6.0", "jest-resolve": "26.6.0", "jest-watch-typeahead": "0.6.1", From cb5d5e18b7ebd60ed86e616bf5c0bbeae732ff37 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Thu, 25 Mar 2021 17:09:50 -0400 Subject: [PATCH 02/10] Upgrade rest of packges from 26.6.0 to 27.0.0-next.6 --- packages/react-scripts/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index a94b9e9429..bd69b843cf 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -59,8 +59,8 @@ "html-webpack-plugin": "4.5.0", "identity-obj-proxy": "3.0.0", "jest": "27.0.0-next.6", - "jest-circus": "26.6.0", - "jest-resolve": "26.6.0", + "jest-circus": "27.0.0-next.6", + "jest-resolve": "27.0.0-next.6", "jest-watch-typeahead": "0.6.1", "mini-css-extract-plugin": "0.11.3", "optimize-css-assets-webpack-plugin": "5.0.4", From b86337c50005899b81045bbbbb380dc29ec13ac4 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Thu, 25 Mar 2021 18:14:07 -0400 Subject: [PATCH 03/10] Add `jsdom` docblock at the top of the test --- packages/react-error-overlay/src/__tests__/get-source-map.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-error-overlay/src/__tests__/get-source-map.js b/packages/react-error-overlay/src/__tests__/get-source-map.js index 072854842e..d234e93a3c 100644 --- a/packages/react-error-overlay/src/__tests__/get-source-map.js +++ b/packages/react-error-overlay/src/__tests__/get-source-map.js @@ -1,3 +1,7 @@ +/** + * @jest-environment jsdom + */ + /** * Copyright (c) 2015-present, Facebook, Inc. * From 1f8a8468828d8873f8d87db890a339dd961adcd5 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Thu, 25 Mar 2021 18:29:11 -0400 Subject: [PATCH 04/10] Import default `babel-jest` in config/jest/babelTransform.js --- packages/react-scripts/config/jest/babelTransform.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/config/jest/babelTransform.js b/packages/react-scripts/config/jest/babelTransform.js index c5830153e8..8a61365182 100644 --- a/packages/react-scripts/config/jest/babelTransform.js +++ b/packages/react-scripts/config/jest/babelTransform.js @@ -8,7 +8,7 @@ // @remove-on-eject-end 'use strict'; -const babelJest = require('babel-jest'); +const babelJest = require('babel-jest').default; const hasJsxRuntime = (() => { if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') { From 92027c6d6802f81cfa7202313433ac3bd07bf647 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Thu, 25 Mar 2021 18:36:53 -0400 Subject: [PATCH 05/10] Import default `babel-jest` in jest.transform.js --- .../fixtures/kitchensink/template/jest.transform.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/fixtures/kitchensink/template/jest.transform.js b/packages/react-scripts/fixtures/kitchensink/template/jest.transform.js index 247f1081b8..3b2d0c56bf 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/jest.transform.js +++ b/packages/react-scripts/fixtures/kitchensink/template/jest.transform.js @@ -1,3 +1,5 @@ const babelOptions = { presets: ['react-app'] }; -module.exports = require('babel-jest').createTransformer(babelOptions); +const babelJest = require('babel-jest').default; + +module.exports = babelJest.createTransformer(babelOptions); From 3087bea50882aef1d8f430e6a8a7f1c97a22d038 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Fri, 26 Mar 2021 10:05:32 -0400 Subject: [PATCH 06/10] PR Review: Remove explicit dependency on `jest-circus` & modify docblock --- .../react-error-overlay/src/__tests__/get-source-map.js | 6 ++---- packages/react-scripts/package.json | 1 - packages/react-scripts/scripts/utils/createJestConfig.js | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/react-error-overlay/src/__tests__/get-source-map.js b/packages/react-error-overlay/src/__tests__/get-source-map.js index d234e93a3c..66e5dc195f 100644 --- a/packages/react-error-overlay/src/__tests__/get-source-map.js +++ b/packages/react-error-overlay/src/__tests__/get-source-map.js @@ -1,12 +1,10 @@ -/** - * @jest-environment jsdom - */ - /** * Copyright (c) 2015-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. + * + * @jest-environment jsdom */ import { getSourceMap } from '../utils/getSourceMap'; diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index bd69b843cf..223a4745d3 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -59,7 +59,6 @@ "html-webpack-plugin": "4.5.0", "identity-obj-proxy": "3.0.0", "jest": "27.0.0-next.6", - "jest-circus": "27.0.0-next.6", "jest-resolve": "27.0.0-next.6", "jest-watch-typeahead": "0.6.1", "mini-css-extract-plugin": "0.11.3", diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index ca316aab5c..ff1c581102 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -39,7 +39,6 @@ module.exports = (resolve, rootDir, isEjecting) => { '/src/**/*.{spec,test}.{js,jsx,ts,tsx}', ], testEnvironment: 'jsdom', - testRunner: require.resolve('jest-circus/runner'), transform: { '^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': resolve( 'config/jest/babelTransform.js' From 8c30f1f003bec04a4e6d80f5255577729e6903d1 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Fri, 26 Mar 2021 10:21:40 -0400 Subject: [PATCH 07/10] Move setTimeout outside beforeEach --- test/fixtures/__shared__/test-setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/__shared__/test-setup.js b/test/fixtures/__shared__/test-setup.js index 30d1ac644a..245f525057 100644 --- a/test/fixtures/__shared__/test-setup.js +++ b/test/fixtures/__shared__/test-setup.js @@ -16,6 +16,6 @@ afterAll(async () => { await testSetup.teardown(); }); -beforeEach(() => jest.setTimeout(1000 * 60 * 5)); +jest.setTimeout(1000 * 60 * 5); module.exports = testSetup; From 9a6ebab5cd6fdc5e14eca2624227b783825dceff Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Fri, 26 Mar 2021 14:47:01 -0400 Subject: [PATCH 08/10] Increase timeout to 15 minutes --- test/fixtures/__shared__/test-setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/__shared__/test-setup.js b/test/fixtures/__shared__/test-setup.js index 245f525057..f94fcce13d 100644 --- a/test/fixtures/__shared__/test-setup.js +++ b/test/fixtures/__shared__/test-setup.js @@ -16,6 +16,6 @@ afterAll(async () => { await testSetup.teardown(); }); -jest.setTimeout(1000 * 60 * 5); +jest.setTimeout(1000 * 60 * 15); module.exports = testSetup; From e14da9155d30d0e9d771042fbb2e37d216a7b1de Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Wed, 26 May 2021 19:11:07 -0400 Subject: [PATCH 09/10] Update jest to 27.0.1 from 27.0.0-next.6 --- package.json | 2 +- packages/babel-plugin-named-asset-import/package.json | 2 +- packages/confusing-browser-globals/package.json | 2 +- packages/create-react-app/package.json | 2 +- packages/react-dev-utils/package.json | 2 +- packages/react-error-overlay/package.json | 2 +- packages/react-scripts/fixtures/kitchensink/template.json | 2 +- packages/react-scripts/package.json | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 03849d3764..8c2551f388 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "get-port": "^5.1.1", "globby": "^11.0.1", "husky": "^4.3.0", - "jest": "27.0.0-next.6", + "jest": "27.0.1", "lerna": "3.22.1", "lerna-changelog": "~0.8.2", "lint-staged": "^10.4.2", diff --git a/packages/babel-plugin-named-asset-import/package.json b/packages/babel-plugin-named-asset-import/package.json index da7bc7cceb..f9643061a3 100644 --- a/packages/babel-plugin-named-asset-import/package.json +++ b/packages/babel-plugin-named-asset-import/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "babel-plugin-tester": "^8.0.1", - "jest": "27.0.0-next.6" + "jest": "27.0.1" }, "scripts": { "test": "jest" diff --git a/packages/confusing-browser-globals/package.json b/packages/confusing-browser-globals/package.json index 675743bdf4..05827e93fc 100644 --- a/packages/confusing-browser-globals/package.json +++ b/packages/confusing-browser-globals/package.json @@ -20,6 +20,6 @@ "index.js" ], "devDependencies": { - "jest": "27.0.0-next.6" + "jest": "27.0.1" } } diff --git a/packages/create-react-app/package.json b/packages/create-react-app/package.json index 94175ba53c..39d1b1e229 100644 --- a/packages/create-react-app/package.json +++ b/packages/create-react-app/package.json @@ -43,6 +43,6 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "27.0.0-next.6" + "jest": "27.0.1" } } diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index c0eaaba274..d09d7d9f8e 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -79,7 +79,7 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "27.0.0-next.6" + "jest": "27.0.1" }, "scripts": { "test": "cross-env FORCE_COLOR=true jest" diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index 07fc3300a2..84e85befd0 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -55,7 +55,7 @@ "eslint-plugin-testing-library": "^3.9.2", "flow-bin": "^0.116.0", "html-entities": "1.3.1", - "jest": "27.0.0-next.6", + "jest": "27.0.1", "jest-fetch-mock": "2.1.2", "object-assign": "4.1.1", "promise": "8.1.0", diff --git a/packages/react-scripts/fixtures/kitchensink/template.json b/packages/react-scripts/fixtures/kitchensink/template.json index 06cb69416f..385d476419 100644 --- a/packages/react-scripts/fixtures/kitchensink/template.json +++ b/packages/react-scripts/fixtures/kitchensink/template.json @@ -2,7 +2,7 @@ "package": { "dependencies": { "bootstrap": "4.3.1", - "jest": "27.0.0-next.6", + "jest": "27.0.1", "node-sass": "4.x", "normalize.css": "7.0.0", "prop-types": "15.7.2", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 223a4745d3..a1fa1a887f 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -58,8 +58,8 @@ "fs-extra": "^9.0.1", "html-webpack-plugin": "4.5.0", "identity-obj-proxy": "3.0.0", - "jest": "27.0.0-next.6", - "jest-resolve": "27.0.0-next.6", + "jest": "27.0.1", + "jest-resolve": "27.0.1", "jest-watch-typeahead": "0.6.1", "mini-css-extract-plugin": "0.11.3", "optimize-css-assets-webpack-plugin": "5.0.4", From 5a2cd804f873de411b7b19137b597f1008959801 Mon Sep 17 00:00:00 2001 From: Ankur Kaushal Date: Tue, 1 Jun 2021 21:46:06 -0400 Subject: [PATCH 10/10] Update to latest `jest` Upgrades from 27.0.1 to 27.0.3 --- package.json | 2 +- packages/babel-plugin-named-asset-import/package.json | 2 +- packages/confusing-browser-globals/package.json | 2 +- packages/create-react-app/package.json | 2 +- packages/react-dev-utils/package.json | 2 +- packages/react-error-overlay/package.json | 2 +- packages/react-scripts/fixtures/kitchensink/template.json | 2 +- packages/react-scripts/package.json | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 8c2551f388..c0545858f2 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "get-port": "^5.1.1", "globby": "^11.0.1", "husky": "^4.3.0", - "jest": "27.0.1", + "jest": "27.0.3", "lerna": "3.22.1", "lerna-changelog": "~0.8.2", "lint-staged": "^10.4.2", diff --git a/packages/babel-plugin-named-asset-import/package.json b/packages/babel-plugin-named-asset-import/package.json index f9643061a3..6c9e9e3b86 100644 --- a/packages/babel-plugin-named-asset-import/package.json +++ b/packages/babel-plugin-named-asset-import/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "babel-plugin-tester": "^8.0.1", - "jest": "27.0.1" + "jest": "27.0.3" }, "scripts": { "test": "jest" diff --git a/packages/confusing-browser-globals/package.json b/packages/confusing-browser-globals/package.json index 05827e93fc..f2f77b8761 100644 --- a/packages/confusing-browser-globals/package.json +++ b/packages/confusing-browser-globals/package.json @@ -20,6 +20,6 @@ "index.js" ], "devDependencies": { - "jest": "27.0.1" + "jest": "27.0.3" } } diff --git a/packages/create-react-app/package.json b/packages/create-react-app/package.json index 39d1b1e229..51d0495828 100644 --- a/packages/create-react-app/package.json +++ b/packages/create-react-app/package.json @@ -43,6 +43,6 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "27.0.1" + "jest": "27.0.3" } } diff --git a/packages/react-dev-utils/package.json b/packages/react-dev-utils/package.json index d09d7d9f8e..cb51655c8b 100644 --- a/packages/react-dev-utils/package.json +++ b/packages/react-dev-utils/package.json @@ -79,7 +79,7 @@ }, "devDependencies": { "cross-env": "^7.0.2", - "jest": "27.0.1" + "jest": "27.0.3" }, "scripts": { "test": "cross-env FORCE_COLOR=true jest" diff --git a/packages/react-error-overlay/package.json b/packages/react-error-overlay/package.json index 84e85befd0..5a4785ec46 100644 --- a/packages/react-error-overlay/package.json +++ b/packages/react-error-overlay/package.json @@ -55,7 +55,7 @@ "eslint-plugin-testing-library": "^3.9.2", "flow-bin": "^0.116.0", "html-entities": "1.3.1", - "jest": "27.0.1", + "jest": "27.0.3", "jest-fetch-mock": "2.1.2", "object-assign": "4.1.1", "promise": "8.1.0", diff --git a/packages/react-scripts/fixtures/kitchensink/template.json b/packages/react-scripts/fixtures/kitchensink/template.json index 385d476419..616fbf63a1 100644 --- a/packages/react-scripts/fixtures/kitchensink/template.json +++ b/packages/react-scripts/fixtures/kitchensink/template.json @@ -2,7 +2,7 @@ "package": { "dependencies": { "bootstrap": "4.3.1", - "jest": "27.0.1", + "jest": "27.0.3", "node-sass": "4.x", "normalize.css": "7.0.0", "prop-types": "15.7.2", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index a1fa1a887f..686d676786 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -58,8 +58,8 @@ "fs-extra": "^9.0.1", "html-webpack-plugin": "4.5.0", "identity-obj-proxy": "3.0.0", - "jest": "27.0.1", - "jest-resolve": "27.0.1", + "jest": "27.0.3", + "jest-resolve": "27.0.3", "jest-watch-typeahead": "0.6.1", "mini-css-extract-plugin": "0.11.3", "optimize-css-assets-webpack-plugin": "5.0.4",