From a1a2c204ce786cbeb6bf4e33b7e40f53b79d329c Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 22 Oct 2022 01:05:53 +0800 Subject: [PATCH] fix(transformer): correct url in error message (#13483) --- CHANGELOG.md | 2 ++ .../__snapshots__/ScriptTransformer.test.ts.snap | 16 ++++++++-------- .../src/runtimeErrorsAndWarnings.ts | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 906e1998ec31..1e903f387072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### Chore & Maintenance +- `[docs]` Update link to Jest 28 upgrade guide in error message ([#13483](https://github.com/facebook/jest/pull/13483)) + ### Performance ## 29.2.1 diff --git a/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap b/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap index 14a7c3379e61..b5b29deb331f 100644 --- a/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap +++ b/packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap @@ -360,7 +360,7 @@ exports[`ScriptTransformer throws an error if \`process\` doesn't return an obje should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -373,7 +373,7 @@ exports[`ScriptTransformer throws an error if \`process\` doesn't return an obje should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -386,7 +386,7 @@ exports[`ScriptTransformer throws an error if \`process\` doesn't return an obje should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -399,7 +399,7 @@ exports[`ScriptTransformer throws an error if \`process\` doesn't return an obje should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -412,7 +412,7 @@ exports[`ScriptTransformer throws an error if \`processAsync\` doesn't return a should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -425,7 +425,7 @@ exports[`ScriptTransformer throws an error if \`processAsync\` doesn't return a should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -438,7 +438,7 @@ exports[`ScriptTransformer throws an error if \`processAsync\` doesn't return a should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " @@ -451,7 +451,7 @@ exports[`ScriptTransformer throws an error if \`processAsync\` doesn't return a should return an object or a Promise resolving to an object. The object must have \`code\` property with a string of processed code. This error may be caused by a breaking change in Jest 28: - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer Code Transformation Documentation: https://jestjs.io/docs/code-transformation " diff --git a/packages/jest-transform/src/runtimeErrorsAndWarnings.ts b/packages/jest-transform/src/runtimeErrorsAndWarnings.ts index 2431dbfc67b8..72f80a68d0b0 100644 --- a/packages/jest-transform/src/runtimeErrorsAndWarnings.ts +++ b/packages/jest-transform/src/runtimeErrorsAndWarnings.ts @@ -17,7 +17,7 @@ const DOCUMENTATION_NOTE = ` ${chalk.bold( const UPGRADE_NOTE = ` ${chalk.bold( 'This error may be caused by a breaking change in Jest 28:', )} - https://jestjs.io/docs/upgrading-to-jest28#transformer + https://jestjs.io/docs/28.x/upgrading-to-jest28#transformer `; export const makeInvalidReturnValueError = (transformPath: string): string =>