Skip to content

Commit

Permalink
refactor(transformers): deprecate path-mapping AST transformer (#3088)
Browse files Browse the repository at this point in the history
DEPRECATION
`path-mapping` AST transformer is deprecated. One should use alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead
  • Loading branch information
ahnpnl authored Nov 22, 2021
1 parent f316352 commit d8f6b96
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 199 deletions.
21 changes: 0 additions & 21 deletions e2e/__tests__/ast-transformers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,6 @@ const executeTest = (testDir: string): void => {
})
}

describe('path-mapping', () => {
const PATH_MAPPING_DIR_NAME = 'path-mapping'

describe('ts-4.5+', () => {
executeTest(`${AST_TRANSFORMERS_DIR_NAME}/${PATH_MAPPING_DIR_NAME}/ts-4.5+`)
})

describe('ts-4.5-', () => {
const DIR = path.join(__dirname, '..', AST_TRANSFORMERS_DIR_NAME, PATH_MAPPING_DIR_NAME, 'ts-4.5-')

beforeAll(() => {
runNpmInstall(DIR)
execa.sync('npm', ['install', '--no-package-lock', '--no-shrinkwrap', '--no-save', tsJestBundle], {
cwd: DIR,
})
})

executeTest(`${AST_TRANSFORMERS_DIR_NAME}/${PATH_MAPPING_DIR_NAME}/ts-4.5-`)
})
})

describe('transformer-options', () => {
const TRANSFORM_OPT_DIR_NAME = 'transformer-options'

Expand Down

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions e2e/ast-transformers/path-mapping/__tests__/export.spec.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion e2e/ast-transformers/path-mapping/share/export.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/ast-transformers/path-mapping/share/foo.ts

This file was deleted.

16 changes: 0 additions & 16 deletions e2e/ast-transformers/path-mapping/ts-4.5+/jest-isolated.config.js

This file was deleted.

16 changes: 0 additions & 16 deletions e2e/ast-transformers/path-mapping/ts-4.5+/package.json

This file was deleted.

16 changes: 0 additions & 16 deletions e2e/ast-transformers/path-mapping/ts-4.5-/jest-isolated.config.js

This file was deleted.

31 changes: 0 additions & 31 deletions e2e/ast-transformers/path-mapping/ts-4.5-/package-lock.json

This file was deleted.

19 changes: 0 additions & 19 deletions e2e/ast-transformers/path-mapping/ts-4.5-/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions e2e/ast-transformers/path-mapping/tsconfig.json

This file was deleted.

3 changes: 3 additions & 0 deletions src/transformers/path-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export function factory({
configSet,
}: TsCompilerInstance): (ctx: _ts.TransformationContext) => _ts.Transformer<_ts.SourceFile> {
const logger = configSet.logger.child({ namespace: name })
logger.warn(
'path-mapping AST transformer is deprecated and will be removed in `ts-jest` v28. Please use an alternative one, like https://github.com/LeDDGroup/typescript-transform-paths instead',
)
const ts = configSet.compilerModule
const tsFactory = ts.factory ? ts.factory : ts
const compilerOptions = configSet.parsedTsConfig.options
Expand Down

0 comments on commit d8f6b96

Please sign in to comment.