Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(transformers): deprecate path-mapping AST transformer #3088

Merged
merged 1 commit into from Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 0 additions & 21 deletions e2e/__tests__/ast-transformers.test.ts
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.

This file was deleted.

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

This file was deleted.

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
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