Skip to content

Commit 5868761

Browse files
authored
fix: introduce transpilation option to replace isolatedModules option (#5044)
When `isolatedModules` option was introduced, the purpose was to indicate that it is a way to enable "transpilation mode", which is similar to other tools like `Babel`, `swc`, `esbuild` are doing. However, this created a big misunderstanding and confusion between `isolatedModules` option in `tsconfig` vs `ts-jest` option. Therefore, `ts-jest` renamed `isolatedModules` option to `transpilation` to make things clearer and updated the deprecation message. Closes #5013 Closes #4859
1 parent 54dee26 commit 5868761

File tree

89 files changed

+194
-409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+194
-409
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import { BarConstEnum } from '../src/bar-constant'
22
import { FooConstEnum } from '../src/foo-constant'
33

4-
const getOne = (): string => BarConstEnum.one
5-
const getTwo = (): string => FooConstEnum.two
6-
74
describe('const-enum', () => {
8-
it('should pass', () => {
9-
expect(getOne()).toBe('ONE')
10-
expect(getTwo()).toBe('TWO')
5+
it('should pass with non transpilation mode', () => {
6+
expect(BarConstEnum.one).toBe('ONE')
7+
expect(FooConstEnum.two).toBe('TWO')
118
})
129
})

e2e/const-enum/jest-transpiler-cjs.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export default {
66
[TS_JS_TRANSFORM_PATTERN]: [
77
'ts-jest',
88
{
9-
tsconfig: '<rootDir>/tsconfig-cjs-transpiler.spec.json',
9+
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
10+
transpilation: true,
1011
},
1112
],
1213
},

e2e/const-enum/jest-transpiler-esm.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export default {
77
[TS_JS_TRANSFORM_PATTERN]: [
88
'ts-jest',
99
{
10-
tsconfig: '<rootDir>/tsconfig-esm-transpiler.spec.json',
10+
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
1111
useESM: true,
12+
transpilation: true,
1213
},
1314
],
1415
},

e2e/const-enum/tsconfig-cjs-transpiler.spec.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

e2e/const-enum/tsconfig-esm-transpiler.spec.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

e2e/enum/jest-transpiler-cjs.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export default {
66
[ESM_TS_JS_TRANSFORM_PATTERN]: [
77
'ts-jest',
88
{
9-
tsconfig: '<rootDir>/tsconfig-cjs-transpiler.spec.json',
9+
tsconfig: '<rootDir>/tsconfig-cjs.spec.json',
10+
transpilation: true,
1011
},
1112
],
1213
},

e2e/enum/jest-transpiler-esm.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export default {
77
[TS_JS_TRANSFORM_PATTERN]: [
88
'ts-jest',
99
{
10-
tsconfig: '<rootDir>/tsconfig-esm-transpiler.spec.json',
10+
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
1111
useESM: true,
12+
transpilation: true,
1213
},
1314
],
1415
},

e2e/enum/tsconfig-cjs-transpiler.spec.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

e2e/enum/tsconfig-esm-transpiler.spec.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

e2e/esm-features/jest-compiler-esm.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
[TS_TRANSFORM_PATTERN]: [
88
'ts-jest',
99
{
10-
tsconfig: '<rootDir>/tsconfig-esm-transpiler.spec.json',
10+
tsconfig: '<rootDir>/tsconfig-esm.spec.json',
1111
useESM: true,
1212
},
1313
],

0 commit comments

Comments
 (0)