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
To write a custom TypeScript AST transformers, one can take a look at [the one](https://github.com/kulshekhar/ts-jest/tree/master/src/transformers) that `ts-jest` is using.
ts-jest[config] (WARN) The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27. Please define your custom AST transformers in a form of an object. More information you can check online documentation https://kulshekhar.github.io/ts-jest/user/config/astTransformers
ts-jest[config] (WARN) The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27. Please define your custom AST transformers in a form of an object. More information you can check online documentation https://kulshekhar.github.io/ts-jest/user/config/astTransformers
exports[`ts-jest logging deprecation warning with astTransformers config as string array should pass using template "with-babel-7-string-config" 1`] = `
ts-jest[config] (WARN) The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27. Please define your custom AST transformers in a form of an object. More information you can check online documentation https://kulshekhar.github.io/ts-jest/user/config/astTransformers
exports[`ts-jest logging with unsupported version test with TS_JEST_DISABLE_VER_CHECKER is not set in process.env should pass using template "with-unsupported-version" 1`] = `
Copy file name to clipboardExpand all lines: src/config/__snapshots__/config-set.spec.ts.snap
+47-3Lines changed: 47 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
-
exports[`cacheKey should be a string 1`] = `"{\\"digest\\":\\"a0d51ca854194df8191d0e65c0ca4730f510f332\\",\\"jest\\":{\\"__backported\\":true,\\"globals\\":{}},\\"projectDepVersions\\":{\\"dev\\":\\"1.2.5\\",\\"opt\\":\\"1.2.3\\",\\"peer\\":\\"1.2.4\\",\\"std\\":\\"1.2.6\\"},\\"transformers\\":[\\"hoisting-jest-mock@1\\"],\\"tsJest\\":{\\"compiler\\":\\"typescript\\",\\"diagnostics\\":{\\"ignoreCodes\\":[6059,18002,18003],\\"pretty\\":true,\\"throws\\":true},\\"isolatedModules\\":false,\\"packageJson\\":{\\"kind\\":\\"file\\"},\\"transformers\\":[],\\"tsConfig\\":{\\"kind\\":\\"file\\",\\"value\\":\\"\\"}},\\"tsconfig\\":{\\"options\\":{\\"configFilePath\\":\\"\\",\\"declaration\\":false,\\"inlineSourceMap\\":false,\\"inlineSources\\":true,\\"module\\":1,\\"noEmit\\":false,\\"removeComments\\":false,\\"sourceMap\\":true,\\"target\\":1,\\"types\\":[]},\\"raw\\":{\\"compileOnSave\\":false,\\"compilerOptions\\":{\\"composite\\":true,\\"declaration\\":true,\\"types\\":[]},\\"exclude\\":[\\"foo/**/*\\"],\\"include\\":[\\"bar/**/*\\"]}}}"`;
3
+
exports[`cacheKey should be a string 1`] = `"{\\"digest\\":\\"a0d51ca854194df8191d0e65c0ca4730f510f332\\",\\"jest\\":{\\"__backported\\":true,\\"globals\\":{}},\\"projectDepVersions\\":{\\"dev\\":\\"1.2.5\\",\\"opt\\":\\"1.2.3\\",\\"peer\\":\\"1.2.4\\",\\"std\\":\\"1.2.6\\"},\\"transformers\\":[\\"hoisting-jest-mock@1\\"],\\"tsJest\\":{\\"compiler\\":\\"typescript\\",\\"diagnostics\\":{\\"ignoreCodes\\":[6059,18002,18003],\\"pretty\\":true,\\"throws\\":true},\\"isolatedModules\\":false,\\"packageJson\\":{\\"kind\\":\\"file\\"},\\"transformers\\":{},\\"tsConfig\\":{\\"kind\\":\\"file\\",\\"value\\":\\"\\"}},\\"tsconfig\\":{\\"options\\":{\\"configFilePath\\":\\"\\",\\"declaration\\":false,\\"inlineSourceMap\\":false,\\"inlineSources\\":true,\\"module\\":1,\\"noEmit\\":false,\\"removeComments\\":false,\\"sourceMap\\":true,\\"target\\":1,\\"types\\":[]},\\"raw\\":{\\"compileOnSave\\":false,\\"compilerOptions\\":{\\"composite\\":true,\\"declaration\\":true,\\"types\\":[]},\\"exclude\\":[\\"foo/**/*\\"],\\"include\\":[\\"bar/**/*\\"]}}}"`;
4
4
5
5
exports[`isTestFile should return a boolean value whether the file matches test pattern 1`] =`true`;
6
6
@@ -67,7 +67,7 @@ Object {
67
67
"value": undefined,
68
68
},
69
69
"stringifyContentPathRegex": undefined,
70
-
"transformers": Array [],
70
+
"transformers": Object {},
71
71
"tsConfig": Object {
72
72
"kind": "file",
73
73
"value": "",
@@ -156,6 +156,45 @@ Array [
156
156
]
157
157
`;
158
158
159
+
exports[`tsCustomTransformers should return an object containing all resolved transformers 1`] =`
160
+
Object {
161
+
"before": Array [
162
+
[Function],
163
+
],
164
+
}
165
+
`;
166
+
167
+
exports[`tsCustomTransformers should return an object containing all resolved transformers 2`] =`
168
+
Object {
169
+
"before": Array [
170
+
[Function],
171
+
[Function],
172
+
],
173
+
}
174
+
`;
175
+
176
+
exports[`tsCustomTransformers should return an object containing all resolved transformers 3`] =`
177
+
Object {
178
+
"after": Array [
179
+
[Function],
180
+
],
181
+
"before": Array [
182
+
[Function],
183
+
],
184
+
}
185
+
`;
186
+
187
+
exports[`tsCustomTransformers should return an object containing all resolved transformers 4`] =`
188
+
Object {
189
+
"afterDeclarations": Array [
190
+
[Function],
191
+
],
192
+
"before": Array [
193
+
[Function],
194
+
],
195
+
}
196
+
`;
197
+
159
198
exports[`tsJest should return correct defaults 1`] =`
160
199
Object {
161
200
"babelConfig": undefined,
@@ -175,10 +214,15 @@ Object {
175
214
"value": undefined,
176
215
},
177
216
"stringifyContentPathRegex": undefined,
178
-
"transformers": Array [],
217
+
"transformers": Object {},
179
218
"tsConfig": Object {
180
219
"kind": "file",
181
220
"value": undefined,
182
221
},
183
222
}
184
223
`;
224
+
225
+
exports[`tsJest transformers should display deprecation warning message when config transformers is string array 1`] =`
226
+
"[level:40] The configuration for astTransformers as string[] is deprecated and will be removed in ts-jest 27. Please define your custom AST transformers in a form of an object. More information you can check online documentation https://kulshekhar.github.io/ts-jest/user/config/astTransformers
0 commit comments