From 49d174268273c93e1ac964845e56830a3ca39e20 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 15 Apr 2026 01:00:16 -0700 Subject: [PATCH 1/5] [heft-jest-plugin] Migrate from @types/heft-jest to @types/jest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the custom @types/heft-jest type shim with the official @types/jest package across all projects. Also removes the jest-global-setup.ts workaround that injected mocked() as a global — Jest 30 ships jest.mocked() as the standard API, so the global shim is no longer appropriate. Co-Authored-By: Claude Sonnet 4.6 --- .../test-data/config-lookup1/tsconfig.json | 2 +- .../test-data/config-lookup2/tsconfig.json | 2 +- .../config-lookup3/src/test/tsconfig.json | 2 +- .../test-data/config-lookup3/tsconfig.json | 2 +- .../test-data/custom-tsdoc-tags/tsconfig.json | 2 +- apps/rush/package.json | 1 - .../heft-node-basic-tutorial/package.json | 2 +- .../heft-node-basic-tutorial/tsconfig.json | 2 +- .../heft-node-jest-tutorial/package.json | 2 +- .../heft-node-jest-tutorial/tsconfig.json | 2 +- .../heft-node-rig-tutorial/package.json | 1 - .../heft-node-rig-tutorial/tsconfig.json | 2 +- .../package.json | 2 +- .../tsconfig.json | 2 +- .../package.json | 1 - .../package.json | 2 +- .../tsconfig.json | 2 +- .../package.json | 1 - .../package.json | 2 +- .../tsconfig.json | 2 +- .../heft-web-rig-app-tutorial/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../heft-webpack-basic-tutorial/package.json | 2 +- .../heft-webpack-basic-tutorial/tsconfig.json | 2 +- .../api-extractor-test-01/package.json | 2 +- build-tests/heft-fastify-test/package.json | 1 - build-tests/heft-fastify-test/tsconfig.json | 2 +- .../config/jest.config.json | 3 - .../heft-jest-preset-test/tsconfig.json | 2 +- .../heft-jest-reporters-test/package.json | 2 +- .../heft-jest-reporters-test/tsconfig.json | 2 +- .../heft-minimal-rig-usage-test/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../heft-node-everything-test/tsconfig.json | 2 +- .../heft-parameter-plugin-test/tsconfig.json | 2 +- .../heft-rspack-everything-test/tsconfig.json | 2 +- build-tests/heft-sass-test/package.json | 2 +- build-tests/heft-sass-test/tsconfig.json | 2 +- build-tests/heft-swc-test/package.json | 2 +- build-tests/heft-swc-test/tsconfig.json | 2 +- .../package.json | 3 +- .../tsconfig-base.json | 2 +- .../package.json | 2 +- .../tsconfig.json | 2 +- .../package.json | 2 +- .../tsconfig.json | 2 +- .../api-extractor/main_2026-04-15-07-54.json | 10 ++ .../rush/main_2026-04-15-07-54.json | 10 ++ .../main_2026-04-15-07-54.json | 10 ++ .../heft-node-rig/main_2026-04-15-07-54.json | 10 ++ .../main_2026-04-15-07-54.json | 10 ++ .../heft-web-rig/main_2026-04-15-07-54.json | 10 ++ .../main_2026-04-15-07-54.json | 10 ++ .../main_2026-04-15-07-54.json | 10 ++ .../build-tests-subspace/pnpm-lock.yaml | 19 ++- .../build-tests-subspace/repo-state.json | 4 +- .../config/subspaces/default/pnpm-lock.yaml | 133 ++++++++---------- .../config/subspaces/default/repo-state.json | 2 +- .../includes/jest-shared.config.json | 3 - heft-plugins/heft-jest-plugin/package.json | 4 + .../src/exports/jest-global-setup.ts | 12 -- libraries/rush-lib/tsconfig.json | 2 +- libraries/rush-sdk/tsconfig.json | 2 +- rigs/heft-node-rig/package.json | 2 +- .../profiles/default/tsconfig-base.json | 2 +- rigs/heft-vscode-extension-rig/package.json | 2 +- .../profiles/default/tsconfig-base.json | 2 +- rigs/heft-web-rig/package.json | 2 +- .../profiles/app/tsconfig-base.json | 2 +- .../profiles/library/tsconfig-base.json | 2 +- rigs/local-node-rig/package.json | 2 +- .../profiles/default/tsconfig-base.json | 2 +- rigs/local-web-rig/package.json | 2 +- .../profiles/app/tsconfig-base.json | 2 +- .../profiles/library/tsconfig-base.json | 2 +- .../rush-resolver-cache-plugin/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- 78 files changed, 208 insertions(+), 172 deletions(-) create mode 100644 common/changes/@microsoft/api-extractor/main_2026-04-15-07-54.json create mode 100644 common/changes/@microsoft/rush/main_2026-04-15-07-54.json create mode 100644 common/changes/@rushstack/heft-jest-plugin/main_2026-04-15-07-54.json create mode 100644 common/changes/@rushstack/heft-node-rig/main_2026-04-15-07-54.json create mode 100644 common/changes/@rushstack/heft-vscode-extension-rig/main_2026-04-15-07-54.json create mode 100644 common/changes/@rushstack/heft-web-rig/main_2026-04-15-07-54.json create mode 100644 common/changes/@rushstack/webpack-workspace-resolve-plugin/main_2026-04-15-07-54.json create mode 100644 common/changes/@rushstack/webpack5-module-minifier-plugin/main_2026-04-15-07-54.json delete mode 100644 heft-plugins/heft-jest-plugin/src/exports/jest-global-setup.ts diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json index b2ec41e1142..a141c3e954b 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup1/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json index b2ec41e1142..a141c3e954b 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup2/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json index b2ec41e1142..a141c3e954b 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup3/src/test/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json b/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json index b2ec41e1142..a141c3e954b 100644 --- a/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/config-lookup3/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json b/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json index b2ec41e1142..a141c3e954b 100644 --- a/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json +++ b/apps/api-extractor/src/api/test/test-data/custom-tsdoc-tags/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/apps/rush/package.json b/apps/rush/package.json index 6050cddd53f..6a556b8e6d6 100644 --- a/apps/rush/package.json +++ b/apps/rush/package.json @@ -48,7 +48,6 @@ "@rushstack/rush-amazon-s3-build-cache-plugin": "workspace:*", "@rushstack/rush-azure-storage-build-cache-plugin": "workspace:*", "@rushstack/rush-http-build-cache-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", "@types/semver": "7.5.0" }, "exports": { diff --git a/build-tests-samples/heft-node-basic-tutorial/package.json b/build-tests-samples/heft-node-basic-tutorial/package.json index f929d22a07f..d2f8675a942 100644 --- a/build-tests-samples/heft-node-basic-tutorial/package.json +++ b/build-tests-samples/heft-node-basic-tutorial/package.json @@ -15,7 +15,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests-samples/heft-node-basic-tutorial/tsconfig.json b/build-tests-samples/heft-node-basic-tutorial/tsconfig.json index f00b374c300..46d511fd04f 100644 --- a/build-tests-samples/heft-node-basic-tutorial/tsconfig.json +++ b/build-tests-samples/heft-node-basic-tutorial/tsconfig.json @@ -18,7 +18,7 @@ "noEmitOnError": false, "allowUnreachableCode": false, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/build-tests-samples/heft-node-jest-tutorial/package.json b/build-tests-samples/heft-node-jest-tutorial/package.json index cb3fea8b244..044a914768d 100644 --- a/build-tests-samples/heft-node-jest-tutorial/package.json +++ b/build-tests-samples/heft-node-jest-tutorial/package.json @@ -14,7 +14,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests-samples/heft-node-jest-tutorial/tsconfig.json b/build-tests-samples/heft-node-jest-tutorial/tsconfig.json index f00b374c300..46d511fd04f 100644 --- a/build-tests-samples/heft-node-jest-tutorial/tsconfig.json +++ b/build-tests-samples/heft-node-jest-tutorial/tsconfig.json @@ -18,7 +18,7 @@ "noEmitOnError": false, "allowUnreachableCode": false, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/build-tests-samples/heft-node-rig-tutorial/package.json b/build-tests-samples/heft-node-rig-tutorial/package.json index 8bf9f48e2e7..3b1d2d0d509 100644 --- a/build-tests-samples/heft-node-rig-tutorial/package.json +++ b/build-tests-samples/heft-node-rig-tutorial/package.json @@ -14,7 +14,6 @@ "local-eslint-config": "workspace:*", "@rushstack/heft": "workspace:*", "@rushstack/heft-node-rig": "workspace:*", - "@types/heft-jest": "1.0.1", "@types/node": "20.17.19", "eslint": "~9.37.0" } diff --git a/build-tests-samples/heft-node-rig-tutorial/tsconfig.json b/build-tests-samples/heft-node-rig-tutorial/tsconfig.json index 8c61f6719f3..af91dc9d42b 100644 --- a/build-tests-samples/heft-node-rig-tutorial/tsconfig.json +++ b/build-tests-samples/heft-node-rig-tutorial/tsconfig.json @@ -2,6 +2,6 @@ "extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { "isolatedModules": true, - "types": ["heft-jest", "node"] + "types": ["jest", "node"] } } diff --git a/build-tests-samples/heft-serverless-stack-tutorial/package.json b/build-tests-samples/heft-serverless-stack-tutorial/package.json index 7ae76842a26..0eb38492889 100644 --- a/build-tests-samples/heft-serverless-stack-tutorial/package.json +++ b/build-tests-samples/heft-serverless-stack-tutorial/package.json @@ -24,7 +24,7 @@ "@serverless-stack/cli": "1.18.4", "@serverless-stack/resources": "1.18.4", "@types/aws-lambda": "8.10.93", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "aws-cdk-lib": "2.189.1", "constructs": "~10.0.98", diff --git a/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json b/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json index fb86ba34edf..3f9ca0d7d77 100644 --- a/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json +++ b/build-tests-samples/heft-serverless-stack-tutorial/tsconfig.json @@ -20,7 +20,7 @@ "skipLibCheck": true, // Some of the AWS dependencies have typings issues - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json b/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json index 5e3ab523a1f..3a57500b42c 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json @@ -40,7 +40,6 @@ "@storybook/core-events": "~6.4.18", "@storybook/react": "~6.4.18", "@storybook/theming": "~6.4.18", - "@types/heft-jest": "1.0.1", "@types/node": "20.17.19", "@types/react-dom": "17.0.25", "@types/react": "17.0.74", diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/package.json b/build-tests-samples/heft-storybook-v6-react-tutorial/package.json index 27f3cea9a0b..4bc6a70f023 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/package.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/package.json @@ -26,7 +26,7 @@ "@rushstack/heft-webpack4-plugin": "workspace:*", "@rushstack/webpack4-module-minifier-plugin": "workspace:*", "@storybook/react": "~6.4.18", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/react": "17.0.74", "@types/react-dom": "17.0.25", diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json b/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json index 7c377b06b33..6bc3d29f6b0 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial/tsconfig.json @@ -19,7 +19,7 @@ "allowUnreachableCode": false, "importHelpers": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json b/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json index 96491daca59..ac5e37dba81 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json @@ -35,7 +35,6 @@ "@storybook/cli": "~9.1.6", "@storybook/react": "~9.1.6", "@storybook/react-webpack5": "~9.1.6", - "@types/heft-jest": "1.0.1", "@types/node": "20.17.19", "@types/react-dom": "19.2.3", "@types/react": "19.2.7", diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/package.json b/build-tests-samples/heft-storybook-v9-react-tutorial/package.json index e259c45bdf6..3c415916e4c 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/package.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/package.json @@ -27,7 +27,7 @@ "@rushstack/webpack5-module-minifier-plugin": "workspace:*", "@storybook/react-webpack5": "~9.1.6", "@storybook/react": "~9.1.6", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/react": "19.2.7", "@types/react-dom": "19.2.3", diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json b/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json index f5e1932b4fe..5b06a6ff332 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial/tsconfig.json @@ -19,7 +19,7 @@ "allowUnreachableCode": false, "importHelpers": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json b/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json index bb41d01a056..94aca74325a 100644 --- a/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json +++ b/build-tests-samples/heft-web-rig-app-tutorial/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "./node_modules/@rushstack/heft-web-rig/profiles/app/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest", "webpack-env"] + "types": ["jest", "webpack-env"] } } diff --git a/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json b/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json index bb41d01a056..94aca74325a 100644 --- a/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json +++ b/build-tests-samples/heft-web-rig-library-tutorial/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "./node_modules/@rushstack/heft-web-rig/profiles/app/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest", "webpack-env"] + "types": ["jest", "webpack-env"] } } diff --git a/build-tests-samples/heft-webpack-basic-tutorial/package.json b/build-tests-samples/heft-webpack-basic-tutorial/package.json index c6767e42dca..9935de8db91 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/package.json +++ b/build-tests-samples/heft-webpack-basic-tutorial/package.json @@ -20,7 +20,7 @@ "@rushstack/heft-typescript-plugin": "workspace:*", "@rushstack/heft-webpack5-plugin": "workspace:*", "@rushstack/heft": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/react": "19.2.7", "@types/react-dom": "19.2.3", "@types/webpack-env": "1.18.8", diff --git a/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json b/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json index 7c377b06b33..6bc3d29f6b0 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json +++ b/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json @@ -19,7 +19,7 @@ "allowUnreachableCode": false, "importHelpers": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests/api-extractor-test-01/package.json b/build-tests/api-extractor-test-01/package.json index ab06a74944d..cd5cf7c1792 100644 --- a/build-tests/api-extractor-test-01/package.json +++ b/build-tests/api-extractor-test-01/package.json @@ -31,7 +31,7 @@ "_phase:build": "heft run --only build -- --clean" }, "dependencies": { - "@types/jest": "29.2.5", + "@types/jest": "30.0.0", "@types/long": "4.0.0", "long": "^4.0.0" }, diff --git a/build-tests/heft-fastify-test/package.json b/build-tests/heft-fastify-test/package.json index 18d04edda9a..976d3f5946b 100644 --- a/build-tests/heft-fastify-test/package.json +++ b/build-tests/heft-fastify-test/package.json @@ -15,7 +15,6 @@ "@rushstack/heft": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", "@types/node": "20.17.19", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests/heft-fastify-test/tsconfig.json b/build-tests/heft-fastify-test/tsconfig.json index b2ec41e1142..a141c3e954b 100644 --- a/build-tests/heft-fastify-test/tsconfig.json +++ b/build-tests/heft-fastify-test/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/build-tests/heft-jest-preset-test/config/jest.config.json b/build-tests/heft-jest-preset-test/config/jest.config.json index c333c603e99..01e3d369776 100644 --- a/build-tests/heft-jest-preset-test/config/jest.config.json +++ b/build-tests/heft-jest-preset-test/config/jest.config.json @@ -69,9 +69,6 @@ // Prefer .cjs to .js to catch explicit commonjs output. Optimize for local files, which will be .cjs "moduleFileExtensions": ["cjs", "js", "json", "node"], - // When using the heft-jest-plugin, these will be replaced with the resolved module location - "setupFiles": ["@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-global-setup.js"], - // When using the heft-jest-plugin, these will be replaced with the resolved module location "resolver": "@rushstack/heft-jest-plugin/lib-commonjs/exports/jest-improved-resolver.js" } diff --git a/build-tests/heft-jest-preset-test/tsconfig.json b/build-tests/heft-jest-preset-test/tsconfig.json index 2df47fa5863..77942323d5f 100644 --- a/build-tests/heft-jest-preset-test/tsconfig.json +++ b/build-tests/heft-jest-preset-test/tsconfig.json @@ -13,7 +13,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest"], + "types": ["jest"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests/heft-jest-reporters-test/package.json b/build-tests/heft-jest-reporters-test/package.json index ab21e16c4c3..11156f770fc 100644 --- a/build-tests/heft-jest-reporters-test/package.json +++ b/build-tests/heft-jest-reporters-test/package.json @@ -16,7 +16,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests/heft-jest-reporters-test/tsconfig.json b/build-tests/heft-jest-reporters-test/tsconfig.json index b84c9d89cbc..c14b5e13900 100644 --- a/build-tests/heft-jest-reporters-test/tsconfig.json +++ b/build-tests/heft-jest-reporters-test/tsconfig.json @@ -13,7 +13,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest"], + "types": ["jest"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests/heft-minimal-rig-usage-test/tsconfig.json b/build-tests/heft-minimal-rig-usage-test/tsconfig.json index 219354d8484..d76275f96eb 100644 --- a/build-tests/heft-minimal-rig-usage-test/tsconfig.json +++ b/build-tests/heft-minimal-rig-usage-test/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "./node_modules/heft-minimal-rig-test/profiles/default/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest", "node"] + "types": ["jest", "node"] } } diff --git a/build-tests/heft-node-everything-esm-module-test/tsconfig.json b/build-tests/heft-node-everything-esm-module-test/tsconfig.json index 550c1aa1ab3..018269cb4ec 100644 --- a/build-tests/heft-node-everything-esm-module-test/tsconfig.json +++ b/build-tests/heft-node-everything-esm-module-test/tsconfig.json @@ -15,7 +15,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/build-tests/heft-node-everything-test/tsconfig.json b/build-tests/heft-node-everything-test/tsconfig.json index f5ce1bd1dcc..347de5f3a4e 100644 --- a/build-tests/heft-node-everything-test/tsconfig.json +++ b/build-tests/heft-node-everything-test/tsconfig.json @@ -16,7 +16,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "commonjs", "target": "es2017", diff --git a/build-tests/heft-parameter-plugin-test/tsconfig.json b/build-tests/heft-parameter-plugin-test/tsconfig.json index f8d1ad8c88b..f93a8eee353 100644 --- a/build-tests/heft-parameter-plugin-test/tsconfig.json +++ b/build-tests/heft-parameter-plugin-test/tsconfig.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest"], + "types": ["jest"], "module": "commonjs", "target": "es2017", diff --git a/build-tests/heft-rspack-everything-test/tsconfig.json b/build-tests/heft-rspack-everything-test/tsconfig.json index 619397b3a75..898cdf85cda 100644 --- a/build-tests/heft-rspack-everything-test/tsconfig.json +++ b/build-tests/heft-rspack-everything-test/tsconfig.json @@ -16,7 +16,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests/heft-sass-test/package.json b/build-tests/heft-sass-test/package.json index cfb96aab1b7..493f5d56b50 100644 --- a/build-tests/heft-sass-test/package.json +++ b/build-tests/heft-sass-test/package.json @@ -19,7 +19,7 @@ "@rushstack/heft-webpack4-plugin": "workspace:*", "@rushstack/heft": "workspace:*", "@rushstack/webpack4-module-minifier-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/react-dom": "19.2.3", "@types/react": "19.2.7", diff --git a/build-tests/heft-sass-test/tsconfig.json b/build-tests/heft-sass-test/tsconfig.json index 2cba886d6d8..c3d716c5d49 100644 --- a/build-tests/heft-sass-test/tsconfig.json +++ b/build-tests/heft-sass-test/tsconfig.json @@ -15,7 +15,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "module": "esnext", "moduleResolution": "node", diff --git a/build-tests/heft-swc-test/package.json b/build-tests/heft-swc-test/package.json index 93bb8168329..807350604ae 100644 --- a/build-tests/heft-swc-test/package.json +++ b/build-tests/heft-swc-test/package.json @@ -17,7 +17,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/webpack-env": "1.18.8", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests/heft-swc-test/tsconfig.json b/build-tests/heft-swc-test/tsconfig.json index e6baff5e52b..3ba11a66303 100644 --- a/build-tests/heft-swc-test/tsconfig.json +++ b/build-tests/heft-swc-test/tsconfig.json @@ -17,7 +17,7 @@ "moduleResolution": "node", "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "module": "esnext", "target": "esnext", diff --git a/build-tests/heft-typescript-composite-test/package.json b/build-tests/heft-typescript-composite-test/package.json index 48dba7975a5..fe878efcf44 100644 --- a/build-tests/heft-typescript-composite-test/package.json +++ b/build-tests/heft-typescript-composite-test/package.json @@ -14,8 +14,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", - "@types/jest": "29.2.5", + "@types/jest": "30.0.0", "@types/webpack-env": "1.18.8", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests/heft-typescript-composite-test/tsconfig-base.json b/build-tests/heft-typescript-composite-test/tsconfig-base.json index b5bf6469742..128b47bf393 100644 --- a/build-tests/heft-typescript-composite-test/tsconfig-base.json +++ b/build-tests/heft-typescript-composite-test/tsconfig-base.json @@ -14,7 +14,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "isolatedModules": true, "verbatimModuleSyntax": true, diff --git a/build-tests/heft-webpack4-everything-test/package.json b/build-tests/heft-webpack4-everything-test/package.json index 0742ce3648d..9e17f24f09b 100644 --- a/build-tests/heft-webpack4-everything-test/package.json +++ b/build-tests/heft-webpack4-everything-test/package.json @@ -20,7 +20,7 @@ "@rushstack/module-minifier": "workspace:*", "@rushstack/node-core-library": "workspace:*", "@rushstack/webpack4-module-minifier-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/webpack-env": "1.18.8", "eslint": "~9.37.0", diff --git a/build-tests/heft-webpack4-everything-test/tsconfig.json b/build-tests/heft-webpack4-everything-test/tsconfig.json index ebef84f93fc..7a85932fe67 100644 --- a/build-tests/heft-webpack4-everything-test/tsconfig.json +++ b/build-tests/heft-webpack4-everything-test/tsconfig.json @@ -16,7 +16,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "incremental": true, "isolatedModules": true, diff --git a/build-tests/heft-webpack5-everything-test/package.json b/build-tests/heft-webpack5-everything-test/package.json index 3e891b7778c..61ef576df2e 100644 --- a/build-tests/heft-webpack5-everything-test/package.json +++ b/build-tests/heft-webpack5-everything-test/package.json @@ -23,7 +23,7 @@ "@rushstack/node-core-library": "workspace:*", "@rushstack/rush-sdk": "workspace:*", "@rushstack/webpack5-module-minifier-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/webpack-env": "1.18.8", "eslint": "~9.37.0", diff --git a/build-tests/heft-webpack5-everything-test/tsconfig.json b/build-tests/heft-webpack5-everything-test/tsconfig.json index 1707aad311e..591ea0e0ac3 100644 --- a/build-tests/heft-webpack5-everything-test/tsconfig.json +++ b/build-tests/heft-webpack5-everything-test/tsconfig.json @@ -16,7 +16,7 @@ "experimentalDecorators": true, "strictNullChecks": true, "noUnusedLocals": true, - "types": ["heft-jest", "webpack-env", "node"], + "types": ["jest", "webpack-env", "node"], "module": "esnext", "moduleResolution": "node", diff --git a/common/changes/@microsoft/api-extractor/main_2026-04-15-07-54.json b/common/changes/@microsoft/api-extractor/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..752ad7dd46f --- /dev/null +++ b/common/changes/@microsoft/api-extractor/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor", + "comment": "", + "type": "none" + } + ], + "packageName": "@microsoft/api-extractor" +} \ No newline at end of file diff --git a/common/changes/@microsoft/rush/main_2026-04-15-07-54.json b/common/changes/@microsoft/rush/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..bd7ff97cb34 --- /dev/null +++ b/common/changes/@microsoft/rush/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-jest-plugin/main_2026-04-15-07-54.json b/common/changes/@rushstack/heft-jest-plugin/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..463b655ae6c --- /dev/null +++ b/common/changes/@rushstack/heft-jest-plugin/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-jest-plugin", + "comment": "Remove the built-in `jest-global-setup` script as Jest 30 ships with the `mocked` function as `jest.mocked`, so including it as a global is now nonstandard.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-jest-plugin" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-node-rig/main_2026-04-15-07-54.json b/common/changes/@rushstack/heft-node-rig/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..e234dd578e4 --- /dev/null +++ b/common/changes/@rushstack/heft-node-rig/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-node-rig", + "comment": "Replace the `@types/heft-jest` types package with `@types/jest`. The `@types/jest` package now correctly includes the mocking typings.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-node-rig" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-vscode-extension-rig/main_2026-04-15-07-54.json b/common/changes/@rushstack/heft-vscode-extension-rig/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..ae1f9ff06b0 --- /dev/null +++ b/common/changes/@rushstack/heft-vscode-extension-rig/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-vscode-extension-rig", + "comment": "Replace the `@types/heft-jest` types package with `@types/jest`. The `@types/jest` package now correctly includes the mocking typings.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-vscode-extension-rig" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-web-rig/main_2026-04-15-07-54.json b/common/changes/@rushstack/heft-web-rig/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..0822354c6f2 --- /dev/null +++ b/common/changes/@rushstack/heft-web-rig/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-web-rig", + "comment": "Replace the `@types/heft-jest` types package with `@types/jest`. The `@types/jest` package now correctly includes the mocking typings.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-web-rig" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack-workspace-resolve-plugin/main_2026-04-15-07-54.json b/common/changes/@rushstack/webpack-workspace-resolve-plugin/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..a7f61b90429 --- /dev/null +++ b/common/changes/@rushstack/webpack-workspace-resolve-plugin/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/webpack-workspace-resolve-plugin", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/webpack-workspace-resolve-plugin" +} \ No newline at end of file diff --git a/common/changes/@rushstack/webpack5-module-minifier-plugin/main_2026-04-15-07-54.json b/common/changes/@rushstack/webpack5-module-minifier-plugin/main_2026-04-15-07-54.json new file mode 100644 index 00000000000..6b6bb2f7f49 --- /dev/null +++ b/common/changes/@rushstack/webpack5-module-minifier-plugin/main_2026-04-15-07-54.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/webpack5-module-minifier-plugin", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/webpack5-module-minifier-plugin" +} \ No newline at end of file diff --git a/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml b/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml index bc85f2f1df0..b1a8a9c1246 100644 --- a/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml +++ b/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml @@ -859,9 +859,12 @@ packages: resolution: {directory: ../../../heft-plugins/heft-jest-plugin, type: directory} peerDependencies: '@rushstack/heft': ^1.2.12 + '@types/jest': ^30.0.0 jest-environment-jsdom: ^30.3.0 jest-environment-node: ^30.3.0 peerDependenciesMeta: + '@types/jest': + optional: true jest-environment-jsdom: optional: true jest-environment-node: @@ -996,9 +999,6 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - '@types/heft-jest@1.0.1': - resolution: {integrity: sha512-cF2iEUpvGh2WgLowHVAdjI05xuDo+GwCA8hGV3Q5PBl8apjd6BTcpPFQ2uPlfUM7BLpgur2xpYo8VeBXopMI4A==} - '@types/html-minifier-terser@6.1.0': resolution: {integrity: sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==} @@ -4753,7 +4753,7 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@rushstack/heft-jest-plugin@file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/node@20.17.19)(jest-environment-node@30.3.0)': + '@rushstack/heft-jest-plugin@file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/jest@30.0.0)(@types/node@20.17.19)(jest-environment-node@30.3.0)': dependencies: '@jest/core': 30.3.0 '@jest/reporters': 30.3.0 @@ -4767,6 +4767,7 @@ snapshots: jest-snapshot: 30.3.0 lodash: 4.18.1 optionalDependencies: + '@types/jest': 30.0.0 jest-environment-node: 30.3.0 transitivePeerDependencies: - '@types/node' @@ -4791,10 +4792,10 @@ snapshots: '@rushstack/eslint-config': file:../../../eslint/eslint-config(eslint@9.37.0)(typescript@5.8.3) '@rushstack/heft': file:../../../apps/heft(@types/node@20.17.19) '@rushstack/heft-api-extractor-plugin': file:../../../heft-plugins/heft-api-extractor-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/node@20.17.19) - '@rushstack/heft-jest-plugin': file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/node@20.17.19)(jest-environment-node@30.3.0) + '@rushstack/heft-jest-plugin': file:../../../heft-plugins/heft-jest-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/jest@30.0.0)(@types/node@20.17.19)(jest-environment-node@30.3.0) '@rushstack/heft-lint-plugin': file:../../../heft-plugins/heft-lint-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/node@20.17.19) '@rushstack/heft-typescript-plugin': file:../../../heft-plugins/heft-typescript-plugin(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/node@20.17.19) - '@types/heft-jest': 1.0.1 + '@types/jest': 30.0.0 eslint: 9.37.0 jest-environment-node: 30.3.0 typescript: 5.8.3 @@ -5004,10 +5005,6 @@ snapshots: '@types/estree@1.0.8': {} - '@types/heft-jest@1.0.1': - dependencies: - '@types/jest': 30.0.0 - '@types/html-minifier-terser@6.1.0': {} '@types/istanbul-lib-coverage@2.0.4': {} @@ -7233,7 +7230,7 @@ snapshots: '@rushstack/eslint-patch': file:../../../eslint/eslint-patch '@rushstack/heft': file:../../../apps/heft(@types/node@20.17.19) '@rushstack/heft-node-rig': file:../../../rigs/heft-node-rig(@rushstack/heft@file:../../../apps/heft(@types/node@20.17.19))(@types/node@20.17.19) - '@types/heft-jest': 1.0.1 + '@types/jest': 30.0.0 '@types/node': 20.17.19 eslint: 9.37.0 jest-junit: 12.3.0 diff --git a/common/config/subspaces/build-tests-subspace/repo-state.json b/common/config/subspaces/build-tests-subspace/repo-state.json index c9e3f41583a..2ddaf0c2184 100644 --- a/common/config/subspaces/build-tests-subspace/repo-state.json +++ b/common/config/subspaces/build-tests-subspace/repo-state.json @@ -1,6 +1,6 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "f64697a6fd77554885eaa2afe57f0c23b5986680", + "pnpmShrinkwrapHash": "b1f311ce3022b7da1f29ddfd0c9f36fc9369eb6a", "preferredVersionsHash": "550b4cee0bef4e97db6c6aad726df5149d20e7d9", - "packageJsonInjectedDependenciesHash": "72a5a71bdaac7129d3bf83e1825848659b987a8c" + "packageJsonInjectedDependenciesHash": "e80c9de7e45c2f3cbe798ef576533088f40e6d37" } diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index c4742e629cb..5fdf58def1f 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -418,9 +418,6 @@ importers: '@rushstack/rush-http-build-cache-plugin': specifier: workspace:* version: link:../../rush-plugins/rush-http-build-cache-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 '@types/semver': specifier: 7.5.0 version: 7.5.0 @@ -544,9 +541,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -574,9 +571,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -598,9 +595,6 @@ importers: '@rushstack/heft-node-rig': specifier: workspace:* version: link:../../rigs/heft-node-rig - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -646,9 +640,9 @@ importers: '@types/aws-lambda': specifier: 8.10.93 version: 8.10.93 - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -707,9 +701,9 @@ importers: '@storybook/react': specifier: ~6.4.18 version: 6.4.22(@babel/core@7.20.12)(@types/node@20.17.19)(@types/react@17.0.74)(@types/webpack@4.41.32)(encoding@0.1.13)(eslint@9.37.0)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@2.19.0)(typescript@5.8.2)(webpack-dev-server@5.2.3(@types/webpack@4.41.32)(webpack@4.47.0))(webpack-hot-middleware@2.26.1) - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -795,9 +789,6 @@ importers: '@storybook/theming': specifier: ~6.4.18 version: 6.4.22(@types/react@17.0.74)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -899,9 +890,9 @@ importers: '@testing-library/dom': specifier: ~7.21.4 version: 7.21.8 - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -981,9 +972,6 @@ importers: '@testing-library/dom': specifier: ~7.21.4 version: 7.21.8 - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -1135,9 +1123,9 @@ importers: '@rushstack/heft-webpack5-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-webpack5-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/react': specifier: 19.2.7 version: 19.2.7 @@ -1357,8 +1345,8 @@ importers: ../../../build-tests/api-extractor-test-01: dependencies: '@types/jest': - specifier: 29.2.5 - version: 29.2.5 + specifier: 30.0.0 + version: 30.0.0 '@types/long': specifier: 4.0.0 version: 4.0.0 @@ -1792,9 +1780,6 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -1858,9 +1843,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -2166,9 +2151,9 @@ importers: '@rushstack/webpack4-module-minifier-plugin': specifier: workspace:* version: link:../../webpack/webpack4-module-minifier-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -2235,9 +2220,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/webpack-env': specifier: 1.18.8 version: 1.18.8 @@ -2265,12 +2250,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 '@types/jest': - specifier: 29.2.5 - version: 29.2.5 + specifier: 30.0.0 + version: 30.0.0 '@types/webpack-env': specifier: 1.18.8 version: 1.18.8 @@ -2439,9 +2421,9 @@ importers: '@rushstack/webpack4-module-minifier-plugin': specifier: workspace:* version: link:../../webpack/webpack4-module-minifier-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -2505,9 +2487,9 @@ importers: '@rushstack/webpack5-module-minifier-plugin': specifier: workspace:* version: link:../../webpack/webpack5-module-minifier-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -4692,9 +4674,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 eslint: specifier: ~9.37.0 version: 9.37.0 @@ -4726,9 +4708,6 @@ importers: '@rushstack/webpack-preserve-dynamic-require-plugin': specifier: workspace:* version: link:../../webpack/preserve-dynamic-require-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 eslint: specifier: ~9.37.0 version: 9.37.0 @@ -4772,9 +4751,9 @@ importers: '@rushstack/heft-webpack5-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-webpack5-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 autoprefixer: specifier: ~10.4.2 version: 10.4.27(postcss@8.4.49) @@ -4851,9 +4830,9 @@ importers: '@rushstack/heft-node-rig': specifier: workspace:* version: link:../heft-node-rig - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -4884,9 +4863,9 @@ importers: '@rushstack/heft-web-rig': specifier: workspace:* version: link:../heft-web-rig - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/webpack-env': specifier: 1.18.8 version: 1.18.8 @@ -10221,12 +10200,12 @@ packages: '@types/jest@28.1.1': resolution: {integrity: sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA==} - '@types/jest@29.2.5': - resolution: {integrity: sha512-H2cSxkKgVmqNHXP7TC2L/WUorrZu8ZigyRywfVzv6EyBlxj39n4C00hjXYQWsbwqgElaj/CiAeSRmk5GoaKTgw==} - '@types/jest@29.5.14': resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/jest@30.0.0': + resolution: {integrity: sha512-XTYugzhuwqWjws0CVz8QpM36+T+Dz5mTEBKhNs/esGLnCIlGdRy+Dq78NRjd7ls7r8BC8ZRMOrKlkO1hU0JOwA==} + '@types/jju@1.4.1': resolution: {integrity: sha512-LFt+YA7Lv2IZROMwokZKiPNORAV5N3huMs3IKnzlE430HWhWYZ8b+78HiwJXJJP1V2IEjinyJURuRJfGoaFSIA==} @@ -26882,15 +26861,15 @@ snapshots: jest-matcher-utils: 27.5.1 pretty-format: 27.5.1 - '@types/jest@29.2.5': + '@types/jest@29.5.14': dependencies: expect: 29.7.0 pretty-format: 29.7.0 - '@types/jest@29.5.14': + '@types/jest@30.0.0': dependencies: - expect: 29.7.0 - pretty-format: 29.7.0 + expect: 30.3.0 + pretty-format: 30.3.0 '@types/jju@1.4.1': {} diff --git a/common/config/subspaces/default/repo-state.json b/common/config/subspaces/default/repo-state.json index 64f208ea51a..ef12deee768 100644 --- a/common/config/subspaces/default/repo-state.json +++ b/common/config/subspaces/default/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "be213be7b90c4797bbc7456ef8ce6bf19e6bb15f", + "pnpmShrinkwrapHash": "ea30c332645caff7b0ad82d2630020c802d69708", "preferredVersionsHash": "029c99bd6e65c5e1f25e2848340509811ff9753c" } diff --git a/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json b/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json index 68347ee0322..4c93c4da8fd 100644 --- a/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json +++ b/heft-plugins/heft-jest-plugin/includes/jest-shared.config.json @@ -77,9 +77,6 @@ // Prefer .cjs to .js to catch explicit commonjs output. Optimize for local files, which will be .js "moduleFileExtensions": ["cjs", "js", "json", "node"], - // When using the heft-jest-plugin, these will be replaced with the resolved module location - "setupFiles": ["../lib-commonjs/exports/jest-global-setup.js"], - // When using the heft-jest-plugin, these will be replaced with the resolved module location "resolver": "../lib-commonjs/exports/jest-improved-resolver.js" } diff --git a/heft-plugins/heft-jest-plugin/package.json b/heft-plugins/heft-jest-plugin/package.json index f88c41394f7..3657fb01902 100644 --- a/heft-plugins/heft-jest-plugin/package.json +++ b/heft-plugins/heft-jest-plugin/package.json @@ -17,10 +17,14 @@ }, "peerDependencies": { "@rushstack/heft": "^1.2.12", + "@types/jest": "^30.0.0", "jest-environment-jsdom": "^30.3.0", "jest-environment-node": "^30.3.0" }, "peerDependenciesMeta": { + "@types/jest": { + "optional": true + }, "jest-environment-jsdom": { "optional": true }, diff --git a/heft-plugins/heft-jest-plugin/src/exports/jest-global-setup.ts b/heft-plugins/heft-jest-plugin/src/exports/jest-global-setup.ts deleted file mode 100644 index c046bfefa4a..00000000000 --- a/heft-plugins/heft-jest-plugin/src/exports/jest-global-setup.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -// See LICENSE in the project root for license information. - -/** - * This is implementation of the `mocked()` global API declared by `@rushstack/heft-jest`. - * The jest-shared.config.json configuration tells Jest to execute this file when setting - * up the test environment. This makes the API available to each test. - */ -// eslint-disable-next-line -(global as any)['mocked'] = function (item: unknown): unknown { - return item; -}; diff --git a/libraries/rush-lib/tsconfig.json b/libraries/rush-lib/tsconfig.json index ab86a280c94..78bc41dbb41 100644 --- a/libraries/rush-lib/tsconfig.json +++ b/libraries/rush-lib/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest", "node", "webpack-env"], + "types": ["jest", "node", "webpack-env"], "skipLibCheck": true, "resolveJsonModule": true, "outDir": "lib-intermediate-commonjs", diff --git a/libraries/rush-sdk/tsconfig.json b/libraries/rush-sdk/tsconfig.json index 6612b05ca1a..a7b61edd144 100644 --- a/libraries/rush-sdk/tsconfig.json +++ b/libraries/rush-sdk/tsconfig.json @@ -5,7 +5,7 @@ "declarationDir": "lib-intermediate-dts", "types": [ "node", - "heft-jest", + "jest", "webpack-env" // Use webpack-env here instead of node so we have __non_webpack_require__ ] } diff --git a/rigs/heft-node-rig/package.json b/rigs/heft-node-rig/package.json index 8860c812db9..61600b0c4cd 100644 --- a/rigs/heft-node-rig/package.json +++ b/rigs/heft-node-rig/package.json @@ -22,7 +22,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "eslint": "~9.37.0", "jest-environment-node": "~30.3.0", "typescript": "~5.8.2" diff --git a/rigs/heft-node-rig/profiles/default/tsconfig-base.json b/rigs/heft-node-rig/profiles/default/tsconfig-base.json index 47e93e11e99..930fe55df86 100644 --- a/rigs/heft-node-rig/profiles/default/tsconfig-base.json +++ b/rigs/heft-node-rig/profiles/default/tsconfig-base.json @@ -18,7 +18,7 @@ "noEmitOnError": false, "allowUnreachableCode": false, - "types": ["heft-jest"], + "types": ["jest"], "typeRoots": ["../../../../../node_modules/@types", "../../node_modules/@types"], "module": "commonjs", diff --git a/rigs/heft-vscode-extension-rig/package.json b/rigs/heft-vscode-extension-rig/package.json index 8efb3d3e51e..de05214c75e 100644 --- a/rigs/heft-vscode-extension-rig/package.json +++ b/rigs/heft-vscode-extension-rig/package.json @@ -20,7 +20,7 @@ "@rushstack/heft-node-rig": "workspace:*", "@rushstack/heft-vscode-extension-plugin": "workspace:*", "@rushstack/heft-webpack5-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "eslint": "~9.37.0", "jest-environment-node": "~30.3.0", "typescript": "~5.8.2", diff --git a/rigs/heft-vscode-extension-rig/profiles/default/tsconfig-base.json b/rigs/heft-vscode-extension-rig/profiles/default/tsconfig-base.json index a1fa195979a..8a3d72acb18 100644 --- a/rigs/heft-vscode-extension-rig/profiles/default/tsconfig-base.json +++ b/rigs/heft-vscode-extension-rig/profiles/default/tsconfig-base.json @@ -22,7 +22,7 @@ "resolveJsonModule": true, "skipLibCheck": true, - "types": ["heft-jest"], + "types": ["jest"], "typeRoots": ["../../../../../node_modules/@types", "../../node_modules/@types"], "module": "commonjs", diff --git a/rigs/heft-web-rig/package.json b/rigs/heft-web-rig/package.json index 5dec87406d4..a062bfbbcd7 100644 --- a/rigs/heft-web-rig/package.json +++ b/rigs/heft-web-rig/package.json @@ -25,7 +25,7 @@ "@rushstack/heft-sass-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", "@rushstack/heft-webpack5-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "autoprefixer": "~10.4.2", "css-loader": "~6.6.0", "css-minimizer-webpack-plugin": "~3.4.1", diff --git a/rigs/heft-web-rig/profiles/app/tsconfig-base.json b/rigs/heft-web-rig/profiles/app/tsconfig-base.json index 3ba69ee3728..304d43f35f1 100644 --- a/rigs/heft-web-rig/profiles/app/tsconfig-base.json +++ b/rigs/heft-web-rig/profiles/app/tsconfig-base.json @@ -20,7 +20,7 @@ "allowUnreachableCode": false, "importHelpers": true, - "types": ["heft-jest"], + "types": ["jest"], "typeRoots": ["../../../../../node_modules/@types", "../../node_modules/@types"], "module": "esnext", diff --git a/rigs/heft-web-rig/profiles/library/tsconfig-base.json b/rigs/heft-web-rig/profiles/library/tsconfig-base.json index 3ba69ee3728..304d43f35f1 100644 --- a/rigs/heft-web-rig/profiles/library/tsconfig-base.json +++ b/rigs/heft-web-rig/profiles/library/tsconfig-base.json @@ -20,7 +20,7 @@ "allowUnreachableCode": false, "importHelpers": true, - "types": ["heft-jest"], + "types": ["jest"], "typeRoots": ["../../../../../node_modules/@types", "../../node_modules/@types"], "module": "esnext", diff --git a/rigs/local-node-rig/package.json b/rigs/local-node-rig/package.json index 9a8256b7c26..656880daa90 100644 --- a/rigs/local-node-rig/package.json +++ b/rigs/local-node-rig/package.json @@ -13,7 +13,7 @@ "@rushstack/eslint-patch": "workspace:*", "@rushstack/heft-node-rig": "workspace:*", "@rushstack/heft": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "local-eslint-config": "workspace:*", "eslint": "~9.37.0", diff --git a/rigs/local-node-rig/profiles/default/tsconfig-base.json b/rigs/local-node-rig/profiles/default/tsconfig-base.json index a70f8605252..3da09670199 100644 --- a/rigs/local-node-rig/profiles/default/tsconfig-base.json +++ b/rigs/local-node-rig/profiles/default/tsconfig-base.json @@ -12,7 +12,7 @@ "declarationDir": "${configDir}/lib-dts", "rootDir": "${configDir}/src", - "types": ["heft-jest", "node"], + "types": ["jest", "node"], "typeRoots": ["${configDir}/node_modules/@types", "../../node_modules/@types"] }, "include": ["${configDir}/src/**/*.ts", "${configDir}/src/**/*.tsx"] diff --git a/rigs/local-web-rig/package.json b/rigs/local-web-rig/package.json index 32af5b941d0..cce2a6dc896 100644 --- a/rigs/local-web-rig/package.json +++ b/rigs/local-web-rig/package.json @@ -13,7 +13,7 @@ "@rushstack/eslint-patch": "workspace:*", "@rushstack/heft-web-rig": "workspace:*", "@rushstack/heft": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/webpack-env": "1.18.8", "local-eslint-config": "workspace:*", "eslint": "~9.37.0", diff --git a/rigs/local-web-rig/profiles/app/tsconfig-base.json b/rigs/local-web-rig/profiles/app/tsconfig-base.json index e609adca759..2662b3149c4 100644 --- a/rigs/local-web-rig/profiles/app/tsconfig-base.json +++ b/rigs/local-web-rig/profiles/app/tsconfig-base.json @@ -15,7 +15,7 @@ "rootDir": "${configDir}/src", "rootDirs": ["${configDir}/src", "${configDir}/temp/sass-ts"], - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "typeRoots": ["${configDir}/node_modules/@types", "../../node_modules/@types"] }, "include": ["${configDir}/src/**/*.ts", "${configDir}/src/**/*.tsx"] diff --git a/rigs/local-web-rig/profiles/library/tsconfig-base.json b/rigs/local-web-rig/profiles/library/tsconfig-base.json index eec41564e0e..16661d1228d 100644 --- a/rigs/local-web-rig/profiles/library/tsconfig-base.json +++ b/rigs/local-web-rig/profiles/library/tsconfig-base.json @@ -12,7 +12,7 @@ "rootDir": "${configDir}/src", "rootDirs": ["${configDir}/src", "${configDir}/temp/sass-ts"], - "types": ["heft-jest", "webpack-env"], + "types": ["jest", "webpack-env"], "typeRoots": ["${configDir}/node_modules/@types", "../../node_modules/@types"] }, "include": ["${configDir}/src/**/*.ts", "${configDir}/src/**/*.tsx"] diff --git a/rush-plugins/rush-resolver-cache-plugin/tsconfig.json b/rush-plugins/rush-resolver-cache-plugin/tsconfig.json index 0107527a7e8..6617edfdf16 100644 --- a/rush-plugins/rush-resolver-cache-plugin/tsconfig.json +++ b/rush-plugins/rush-resolver-cache-plugin/tsconfig.json @@ -2,6 +2,6 @@ "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { - "types": ["heft-jest", "node", "webpack-env"] + "types": ["jest", "node", "webpack-env"] } } diff --git a/webpack/webpack-workspace-resolve-plugin/tsconfig.json b/webpack/webpack-workspace-resolve-plugin/tsconfig.json index c4bf22522fe..5e6b46818ad 100644 --- a/webpack/webpack-workspace-resolve-plugin/tsconfig.json +++ b/webpack/webpack-workspace-resolve-plugin/tsconfig.json @@ -2,6 +2,6 @@ "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { "target": "ES2020", - "types": ["heft-jest", "node"] + "types": ["jest", "node"] } } diff --git a/webpack/webpack5-module-minifier-plugin/tsconfig.json b/webpack/webpack5-module-minifier-plugin/tsconfig.json index ac46d65cae3..973b5aad110 100644 --- a/webpack/webpack5-module-minifier-plugin/tsconfig.json +++ b/webpack/webpack5-module-minifier-plugin/tsconfig.json @@ -2,6 +2,6 @@ "extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json", "compilerOptions": { "target": "ES2019", - "types": ["heft-jest", "node", "estree"] + "types": ["jest", "node", "estree"] } } From 4cc1a6dfea7c8f5c8696a6ba88e10abc35bb8565 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 15 Apr 2026 01:12:43 -0700 Subject: [PATCH 2/5] fixup! [heft-jest-plugin] Migrate from @types/heft-jest to @types/jest --- .../heft-node-rig-tutorial/package.json | 1 + .../package.json | 1 + .../package.json | 1 + build-tests/heft-fastify-test/package.json | 1 + .../heft-jest-preset-test/package.json | 2 +- .../heft-minimal-rig-usage-test/package.json | 2 +- .../package.json | 2 +- .../heft-node-everything-test/package.json | 2 +- .../heft-parameter-plugin-test/package.json | 2 +- .../heft-rspack-everything-test/package.json | 2 +- .../config/subspaces/default/pnpm-lock.yaml | 51 ++++++++++++------- 11 files changed, 43 insertions(+), 24 deletions(-) diff --git a/build-tests-samples/heft-node-rig-tutorial/package.json b/build-tests-samples/heft-node-rig-tutorial/package.json index 3b1d2d0d509..84412af9589 100644 --- a/build-tests-samples/heft-node-rig-tutorial/package.json +++ b/build-tests-samples/heft-node-rig-tutorial/package.json @@ -14,6 +14,7 @@ "local-eslint-config": "workspace:*", "@rushstack/heft": "workspace:*", "@rushstack/heft-node-rig": "workspace:*", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0" } diff --git a/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json b/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json index 3a57500b42c..83f9a52f58d 100644 --- a/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json +++ b/build-tests-samples/heft-storybook-v6-react-tutorial-storykit/package.json @@ -40,6 +40,7 @@ "@storybook/core-events": "~6.4.18", "@storybook/react": "~6.4.18", "@storybook/theming": "~6.4.18", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/react-dom": "17.0.25", "@types/react": "17.0.74", diff --git a/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json b/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json index ac5e37dba81..fd0b2858e4c 100644 --- a/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json +++ b/build-tests-samples/heft-storybook-v9-react-tutorial-storykit/package.json @@ -35,6 +35,7 @@ "@storybook/cli": "~9.1.6", "@storybook/react": "~9.1.6", "@storybook/react-webpack5": "~9.1.6", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "@types/react-dom": "19.2.3", "@types/react": "19.2.7", diff --git a/build-tests/heft-fastify-test/package.json b/build-tests/heft-fastify-test/package.json index 976d3f5946b..4d5f783758d 100644 --- a/build-tests/heft-fastify-test/package.json +++ b/build-tests/heft-fastify-test/package.json @@ -15,6 +15,7 @@ "@rushstack/heft": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/build-tests/heft-jest-preset-test/package.json b/build-tests/heft-jest-preset-test/package.json index 48d8cfce0d5..d96626daeba 100644 --- a/build-tests/heft-jest-preset-test/package.json +++ b/build-tests/heft-jest-preset-test/package.json @@ -15,7 +15,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", "typescript": "~5.8.2" diff --git a/build-tests/heft-minimal-rig-usage-test/package.json b/build-tests/heft-minimal-rig-usage-test/package.json index b170c16c4f7..645bf2f314b 100644 --- a/build-tests/heft-minimal-rig-usage-test/package.json +++ b/build-tests/heft-minimal-rig-usage-test/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@rushstack/heft": "workspace:*", "@rushstack/heft-jest-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "heft-minimal-rig-test": "workspace:*" } diff --git a/build-tests/heft-node-everything-esm-module-test/package.json b/build-tests/heft-node-everything-esm-module-test/package.json index cffaca35a45..d5047720980 100644 --- a/build-tests/heft-node-everything-esm-module-test/package.json +++ b/build-tests/heft-node-everything-esm-module-test/package.json @@ -19,7 +19,7 @@ "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-static-asset-typings-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "heft-example-plugin-01": "workspace:*", diff --git a/build-tests/heft-node-everything-test/package.json b/build-tests/heft-node-everything-test/package.json index fcf92f04c29..c3f7da1fe32 100644 --- a/build-tests/heft-node-everything-test/package.json +++ b/build-tests/heft-node-everything-test/package.json @@ -20,7 +20,7 @@ "@rushstack/heft-jest-plugin": "workspace:*", "@rushstack/heft-lint-plugin": "workspace:*", "@rushstack/heft-typescript-plugin": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "heft-example-lifecycle-plugin": "workspace:*", diff --git a/build-tests/heft-parameter-plugin-test/package.json b/build-tests/heft-parameter-plugin-test/package.json index d30cf69eaed..32e408f7aab 100644 --- a/build-tests/heft-parameter-plugin-test/package.json +++ b/build-tests/heft-parameter-plugin-test/package.json @@ -15,7 +15,7 @@ "@rushstack/heft-typescript-plugin": "workspace:*", "@rushstack/heft": "workspace:*", "@rushstack/node-core-library": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "heft-parameter-plugin": "workspace:*", "typescript": "~5.8.2" diff --git a/build-tests/heft-rspack-everything-test/package.json b/build-tests/heft-rspack-everything-test/package.json index 9ef1796e971..62e05f4e2ab 100644 --- a/build-tests/heft-rspack-everything-test/package.json +++ b/build-tests/heft-rspack-everything-test/package.json @@ -20,7 +20,7 @@ "@rushstack/heft": "workspace:*", "@rushstack/node-core-library": "workspace:*", "@rushstack/rush-sdk": "workspace:*", - "@types/heft-jest": "1.0.1", + "@types/jest": "30.0.0", "@types/node": "20.17.19", "eslint": "~9.37.0", "local-eslint-config": "workspace:*", diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index 5fdf58def1f..e10e8f4cd7c 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -595,6 +595,9 @@ importers: '@rushstack/heft-node-rig': specifier: workspace:* version: link:../../rigs/heft-node-rig + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -789,6 +792,9 @@ importers: '@storybook/theming': specifier: ~6.4.18 version: 6.4.22(@types/react@17.0.74)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -972,6 +978,9 @@ importers: '@testing-library/dom': specifier: ~7.21.4 version: 7.21.8 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -1780,6 +1789,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -1810,9 +1822,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 eslint: specifier: ~9.37.0 version: 9.37.0 @@ -1906,9 +1918,9 @@ importers: '@rushstack/heft-jest-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-jest-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -1939,9 +1951,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -1987,9 +1999,9 @@ importers: '@rushstack/heft-typescript-plugin': specifier: workspace:* version: link:../../heft-plugins/heft-typescript-plugin - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -2060,9 +2072,9 @@ importers: '@rushstack/node-core-library': specifier: workspace:* version: link:../../libraries/node-core-library - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -2105,9 +2117,9 @@ importers: '@rushstack/rush-sdk': specifier: workspace:* version: link:../../libraries/rush-sdk - '@types/heft-jest': - specifier: 1.0.1 - version: 1.0.1 + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 '@types/node': specifier: 20.17.19 version: 20.17.19 @@ -4708,6 +4720,9 @@ importers: '@rushstack/webpack-preserve-dynamic-require-plugin': specifier: workspace:* version: link:../../webpack/preserve-dynamic-require-plugin + '@types/jest': + specifier: 30.0.0 + version: 30.0.0 eslint: specifier: ~9.37.0 version: 9.37.0 From bd751cff06f9f5dd6006bbad2e362b6417c47c6a Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 15 Apr 2026 01:14:01 -0700 Subject: [PATCH 3/5] Fix `mocked` references. --- .../src/guide/01-automatic-mock.test.ts | 6 +++--- .../src/guide/02-manual-mock/SoundPlayerConsumer.test.ts | 2 +- .../src/guide/03-factory-constructor-mock.test.ts | 2 +- .../src/test/HttpBuildCacheProvider.test.ts | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build-tests-samples/heft-node-jest-tutorial/src/guide/01-automatic-mock.test.ts b/build-tests-samples/heft-node-jest-tutorial/src/guide/01-automatic-mock.test.ts index c3a6e1a4d98..66cbc4c33cf 100644 --- a/build-tests-samples/heft-node-jest-tutorial/src/guide/01-automatic-mock.test.ts +++ b/build-tests-samples/heft-node-jest-tutorial/src/guide/01-automatic-mock.test.ts @@ -11,7 +11,7 @@ import { SoundPlayerConsumer } from './SoundPlayerConsumer'; beforeEach(() => { // Clear all instances and calls to constructor and all methods: - mocked(SoundPlayer).mockClear(); + jest.mocked(SoundPlayer).mockClear(); }); it('We can check if the consumer called the class constructor', () => { @@ -31,9 +31,9 @@ it('We can check if the consumer called a method on the class instance', () => { soundPlayerConsumer.playSomethingCool(); // mock.instances is available with automatic mocks: - const mockSoundPlayerInstance: SoundPlayer = mocked(SoundPlayer).mock.instances[0]; + const mockSoundPlayerInstance: SoundPlayer = jest.mocked(SoundPlayer).mock.instances[0]; - const mockPlaySoundFile = mocked(mockSoundPlayerInstance.playSoundFile); + const mockPlaySoundFile = jest.mocked(mockSoundPlayerInstance.playSoundFile); expect(mockPlaySoundFile.mock.calls[0][0]).toEqual(coolSoundFileName); // Equivalent to above check: diff --git a/build-tests-samples/heft-node-jest-tutorial/src/guide/02-manual-mock/SoundPlayerConsumer.test.ts b/build-tests-samples/heft-node-jest-tutorial/src/guide/02-manual-mock/SoundPlayerConsumer.test.ts index af79f63945d..93a782faf56 100644 --- a/build-tests-samples/heft-node-jest-tutorial/src/guide/02-manual-mock/SoundPlayerConsumer.test.ts +++ b/build-tests-samples/heft-node-jest-tutorial/src/guide/02-manual-mock/SoundPlayerConsumer.test.ts @@ -12,7 +12,7 @@ import { SoundPlayerConsumer } from './SoundPlayerConsumer'; beforeEach(() => { // Clear all instances and calls to constructor and all methods: - mocked(SoundPlayer).mockClear(); + jest.mocked(SoundPlayer).mockClear(); mockPlaySoundFile.mockClear(); }); diff --git a/build-tests-samples/heft-node-jest-tutorial/src/guide/03-factory-constructor-mock.test.ts b/build-tests-samples/heft-node-jest-tutorial/src/guide/03-factory-constructor-mock.test.ts index bcd44bb804f..1309c70e898 100644 --- a/build-tests-samples/heft-node-jest-tutorial/src/guide/03-factory-constructor-mock.test.ts +++ b/build-tests-samples/heft-node-jest-tutorial/src/guide/03-factory-constructor-mock.test.ts @@ -18,7 +18,7 @@ import { SoundPlayerConsumer } from './SoundPlayerConsumer'; import { SoundPlayer } from './SoundPlayer'; beforeEach(() => { - mocked(SoundPlayer).mockClear(); + jest.mocked(SoundPlayer).mockClear(); mockPlaySoundFile.mockClear(); }); diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index a86ddb342de..822eb9ae11e 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -49,7 +49,7 @@ describe('HttpBuildCacheProvider', () => { const session: RushSession = {} as RushSession; const provider = new HttpBuildCacheProvider(EXAMPLE_OPTIONS, session); - mocked(fetchFn).mockResolvedValue({ + jest.mocked(fetchFn).mockResolvedValue({ status: 401, statusText: 'Unauthorized', ok: false @@ -86,17 +86,17 @@ Array [ const session: RushSession = {} as RushSession; const provider = new HttpBuildCacheProvider(EXAMPLE_OPTIONS, session); - mocked(fetchFn).mockResolvedValueOnce({ + jest.mocked(fetchFn).mockResolvedValueOnce({ status: 500, statusText: 'InternalServiceError', ok: false }); - mocked(fetchFn).mockResolvedValueOnce({ + jest.mocked(fetchFn).mockResolvedValueOnce({ status: 503, statusText: 'ServiceUnavailable', ok: false }); - mocked(fetchFn).mockResolvedValueOnce({ + jest.mocked(fetchFn).mockResolvedValueOnce({ status: 504, statusText: 'BadGateway', ok: false From 842445d14f4ba8fc2fc2ae4ee2240b579ba83777 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 15 Apr 2026 01:25:04 -0700 Subject: [PATCH 4/5] Include es2015.symbol.wellknown. --- .../heft-typescript-composite-test/tsconfig-base.json | 10 +++++++++- .../heft-web-rig/jest-typings_2026-04-15-08-24.json | 10 ++++++++++ rigs/heft-web-rig/profiles/app/tsconfig-base.json | 10 +++++++++- rigs/heft-web-rig/profiles/library/tsconfig-base.json | 10 +++++++++- rigs/local-web-rig/profiles/app/tsconfig-base.json | 10 +++++++++- 5 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 common/changes/@rushstack/heft-web-rig/jest-typings_2026-04-15-08-24.json diff --git a/build-tests/heft-typescript-composite-test/tsconfig-base.json b/build-tests/heft-typescript-composite-test/tsconfig-base.json index 128b47bf393..d312c6331c2 100644 --- a/build-tests/heft-typescript-composite-test/tsconfig-base.json +++ b/build-tests/heft-typescript-composite-test/tsconfig-base.json @@ -22,6 +22,14 @@ "module": "esnext", "moduleResolution": "node", "target": "es5", - "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] + "lib": [ + "es5", + "scripthost", + "es2015.collection", + "es2015.promise", + "es2015.iterable", + "es2015.symbol.wellknown", + "dom" + ] } } diff --git a/common/changes/@rushstack/heft-web-rig/jest-typings_2026-04-15-08-24.json b/common/changes/@rushstack/heft-web-rig/jest-typings_2026-04-15-08-24.json new file mode 100644 index 00000000000..1bbbaf1b6c6 --- /dev/null +++ b/common/changes/@rushstack/heft-web-rig/jest-typings_2026-04-15-08-24.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-web-rig", + "comment": "Include `es2015.symbol.wellknown` in the default included `lib`s in `tsconfig-base.json`.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft-web-rig" +} \ No newline at end of file diff --git a/rigs/heft-web-rig/profiles/app/tsconfig-base.json b/rigs/heft-web-rig/profiles/app/tsconfig-base.json index 304d43f35f1..9fbb01d5b64 100644 --- a/rigs/heft-web-rig/profiles/app/tsconfig-base.json +++ b/rigs/heft-web-rig/profiles/app/tsconfig-base.json @@ -26,7 +26,15 @@ "module": "esnext", "moduleResolution": "node", "target": "es5", - "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"], + "lib": [ + "es5", + "scripthost", + "es2015.collection", + "es2015.promise", + "es2015.iterable", + "es2015.symbol.wellknown", + "dom" + ], "incremental": true }, diff --git a/rigs/heft-web-rig/profiles/library/tsconfig-base.json b/rigs/heft-web-rig/profiles/library/tsconfig-base.json index 304d43f35f1..9fbb01d5b64 100644 --- a/rigs/heft-web-rig/profiles/library/tsconfig-base.json +++ b/rigs/heft-web-rig/profiles/library/tsconfig-base.json @@ -26,7 +26,15 @@ "module": "esnext", "moduleResolution": "node", "target": "es5", - "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"], + "lib": [ + "es5", + "scripthost", + "es2015.collection", + "es2015.promise", + "es2015.iterable", + "es2015.symbol.wellknown", + "dom" + ], "incremental": true }, diff --git a/rigs/local-web-rig/profiles/app/tsconfig-base.json b/rigs/local-web-rig/profiles/app/tsconfig-base.json index 2662b3149c4..394425b7a91 100644 --- a/rigs/local-web-rig/profiles/app/tsconfig-base.json +++ b/rigs/local-web-rig/profiles/app/tsconfig-base.json @@ -8,7 +8,15 @@ "isolatedModules": true, "target": "es2017", - "lib": ["es2017", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"], + "lib": [ + "es2017", + "scripthost", + "es2015.collection", + "es2015.promise", + "es2015.iterable", + "es2015.symbol.wellknown", + "dom" + ], "outDir": "${configDir}/lib-esm", "declarationDir": "${configDir}/lib-dts", From 5b32cd462510a69c06d16ef66bb358ec1ebba3a6 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Wed, 15 Apr 2026 08:18:08 -0700 Subject: [PATCH 5/5] fixup! Include es2015.symbol.wellknown. --- .../heft-webpack-basic-tutorial/tsconfig.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json b/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json index 6bc3d29f6b0..80dbef20d99 100644 --- a/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json +++ b/build-tests-samples/heft-webpack-basic-tutorial/tsconfig.json @@ -24,7 +24,15 @@ "module": "esnext", "moduleResolution": "node", "target": "es5", - "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"] + "lib": [ + "es5", + "scripthost", + "es2015.collection", + "es2015.promise", + "es2015.iterable", + "es2015.symbol.wellknown", + "dom" + ] }, "include": ["src/**/*.ts", "src/**/*.tsx"] }