diff --git a/src/config/config-set.spec.ts b/src/config/config-set.spec.ts index 1e37b62075..daef3118c9 100644 --- a/src/config/config-set.spec.ts +++ b/src/config/config-set.spec.ts @@ -103,7 +103,7 @@ describe('parsedTsConfig', () => { allowSyntheticDefaultImports: true, esModuleInterop: false, }) - expect(target.lines.warn.join()).toMatchInlineSnapshot(` + expect(target.lines.warn.last).toMatchInlineSnapshot(` "[level:40] message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. " `) diff --git a/src/config/config-set.ts b/src/config/config-set.ts index bed37f662b..5fe2aeaffa 100644 --- a/src/config/config-set.ts +++ b/src/config/config-set.ts @@ -452,6 +452,13 @@ export class ConfigSet { // parse json, merge config extending others, ... const result = ts.parseJsonConfigFileContent(config, ts.sys, basePath, undefined, configFileName) + if (result.options.sourceMap === false) { + this.logger.warn( + interpolate(Deprecations.SourceMapFalseNote, { + path: result.options.configFilePath, + }), + ) + } const { _overriddenCompilerOptions: forcedOptions } = this const finalOptions = result.options // Target ES5 output by default (instead of ES3). diff --git a/src/utils/messages.ts b/src/utils/messages.ts index 935aa13de7..851e274509 100644 --- a/src/utils/messages.ts +++ b/src/utils/messages.ts @@ -42,6 +42,7 @@ export const enum Deprecations { TsConfig = 'The option `tsConfig` is deprecated and will be removed in ts-jest 27, use `tsconfig` instead', PackageJson = 'The option `packageJson` is deprecated and will be removed in ts-jest 27. This option is not used by internal `ts-jest`', PathRegex = 'The option `pathRegex` is deprecated and will be removed in ts-jest 27, use `exclude` instead', + SourceMapFalseNote = 'Got `sourceMap: false` from tsconfig file "{{path}}". This will disable source map support in ts-jest 27. Please set `sourceMap: true` in your tsconfig file "{{path}}" if you want to keep source map support on', } /**