You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(config): allow to override resolve tsconfig behavior (#2063)
This change is needed because some jest transformers which want to reuse/extend our `ConfigSet` but want to change the default behavior when reading and resolving tsconfig.
This PR introduces:
- Change `_readTsConfig` to `_resolveTsConfig` and set `_resolveTsConfig` to `protected`
- Allow to override `_resolveTsConfig` via overload signature
- Expose `_transformCfgStr`, `_configSet`, `_overriddenCompilerOptions`
exports[`_resolveTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and allowSyntheticDefaultImports is false in tsConfig should use correct paths when searching 1`] =`
4
+
Array [
5
+
Object {
6
+
"category": 3,
7
+
"code": 151001,
8
+
"file": undefined,
9
+
"length": undefined,
10
+
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
11
+
"start": undefined,
12
+
},
13
+
]
14
+
`;
15
+
16
+
exports[`_resolveTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and allowSyntheticDefaultImports is false in tsConfig should use given tsconfig path 1`] =`
17
+
Array [
18
+
Object {
19
+
"category": 3,
20
+
"code": 151001,
21
+
"file": undefined,
22
+
"length": undefined,
23
+
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
24
+
"start": undefined,
25
+
},
26
+
]
27
+
`;
28
+
29
+
exports[`_resolveTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and esModuleInterop is not in tsConfig should use correct paths when searching 1`] =`
30
+
Array [
31
+
Object {
32
+
"category": 3,
33
+
"code": 151001,
34
+
"file": undefined,
35
+
"length": undefined,
36
+
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
37
+
"start": undefined,
38
+
},
39
+
]
40
+
`;
41
+
42
+
exports[`_resolveTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and esModuleInterop is not in tsConfig should use given tsconfig path 1`] =`
43
+
Array [
44
+
Object {
45
+
"category": 3,
46
+
"code": 151001,
47
+
"file": undefined,
48
+
"length": undefined,
49
+
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
50
+
"start": undefined,
51
+
},
52
+
]
53
+
`;
54
+
3
55
exports[`customTransformers should return an object containing all resolved transformers 1`] =`
4
56
Object {
5
57
"before": Array [
@@ -55,55 +107,3 @@ exports[`isTestFile should return a boolean value whether the file matches test
55
107
exports[`isTestFile should return a boolean value whether the file matches test pattern 3`] =`true`;
56
108
57
109
exports[`isTestFile should return a boolean value whether the file matches test pattern 4`] =`true`;
58
-
59
-
exports[`readTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and allowSyntheticDefaultImports is false in tsConfig should use correct paths when searching 1`] =`
60
-
Array [
61
-
Object {
62
-
"category": 3,
63
-
"code": 151001,
64
-
"file": undefined,
65
-
"length": undefined,
66
-
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
67
-
"start": undefined,
68
-
},
69
-
]
70
-
`;
71
-
72
-
exports[`readTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and allowSyntheticDefaultImports is false in tsConfig should use given tsconfig path 1`] =`
73
-
Array [
74
-
Object {
75
-
"category": 3,
76
-
"code": 151001,
77
-
"file": undefined,
78
-
"length": undefined,
79
-
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
80
-
"start": undefined,
81
-
},
82
-
]
83
-
`;
84
-
85
-
exports[`readTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and esModuleInterop is not in tsConfig should use correct paths when searching 1`] =`
86
-
Array [
87
-
Object {
88
-
"category": 3,
89
-
"code": 151001,
90
-
"file": undefined,
91
-
"length": undefined,
92
-
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
93
-
"start": undefined,
94
-
},
95
-
]
96
-
`;
97
-
98
-
exports[`readTsConfig resolve configFileName normally module in tsConfig is not the same as forced module and esModuleInterop is not in tsConfig should use given tsconfig path 1`] =`
99
-
Array [
100
-
Object {
101
-
"category": 3,
102
-
"code": 151001,
103
-
"file": undefined,
104
-
"length": undefined,
105
-
"messageText": "If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.",
0 commit comments