Skip to content

Commit

Permalink
refactor(config): show warning message for sourceMap: false
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed May 5, 2021
1 parent e448638 commit bde37bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/config/config-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions src/utils/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}

/**
Expand Down

0 comments on commit bde37bb

Please sign in to comment.