Skip to content

Commit

Permalink
fix: revert deprecation message for TsJestTransformer (#3466)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored Apr 27, 2022
1 parent 543b4ad commit cefa0da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export * from './types'

export default {
createTransformer() {
return new TsJestTransformer(true)
return new TsJestTransformer()
},
}
7 changes: 2 additions & 5 deletions src/legacy/ts-jest-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { DECLARATION_TYPE_EXT, JS_JSX_REGEX, TS_TSX_REGEX } from '../constants'
import type { CompilerInstance, DepGraphInfo, ProjectConfigTsJest, TransformOptionsTsJest } from '../types'
import { parse, stringify, JsonableValue, rootLogger } from '../utils'
import { importer } from '../utils/importer'
import { Deprecations, Errors, interpolate } from '../utils/messages'
import { Errors, interpolate } from '../utils/messages'
import { sha1 } from '../utils/sha1'
import { VersionCheckers } from '../utils/version-checkers'

Expand Down Expand Up @@ -49,12 +49,9 @@ export class TsJestTransformer implements SyncTransformer {
private _depGraphs: Map<string, DepGraphInfo> = new Map<string, DepGraphInfo>()
private _watchMode = false

constructor(isLegacy = false) {
constructor() {
this._logger = rootLogger.child({ namespace: 'ts-jest-transformer' })
VersionCheckers.jest.warn()
if (isLegacy) {
this._logger.warn(Deprecations.LegacyTransformerEntry)
}
/**
* For some unknown reasons, `this` is undefined in `getCacheKey` and `process`
* when running Jest in ESM mode
Expand Down
7 changes: 0 additions & 7 deletions src/utils/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ export const enum Deprecations {
ConfigOption = '"[jest-config].{{oldPath}}" is deprecated, use "[jest-config].{{newPath}}" instead.',
ConfigOptionWithNote = '"[jest-config].{{oldPath}}" is deprecated, use "[jest-config].{{newPath}}" instead.\n ↳ {{note}}',
ConfigOptionUseBabelRcNote = 'See `babel-jest` related issue: https://github.com/facebook/jest/issues/3845',
LegacyTransformerEntry = `Use 'ts-jest' entry point in v28 will resolve in refactored transformer. If you wish to use legacy transformer, please adjust your Jest 'transform' config. For example:
module.exports = {
transform: {
'^.+\\\\.tsx?$': 'ts-jest/legacy'
}
}
`,
}

/**
Expand Down

0 comments on commit cefa0da

Please sign in to comment.