@@ -110,44 +110,80 @@ exports[`config init should update package.json for config type js-with-ts-full-
110
110
} "
111
111
` ;
112
112
113
- exports [` config migrate should migrate globals ts-jest config to transformer config 1` ] = `
114
- ""jest": {
115
- " transform" : {
116
- " ^.+\\\\ .tsx?$" : [
117
- " ts-jest" ,
118
- {
119
- " tsconfig" : " ./tsconfig.json"
120
- }
121
- ]
113
+ exports [` config migrate should generate transform config with existing transform options for js-with-babel 1` ] = `
114
+ "module.exports = {
115
+ transform : {
116
+ ' ^.+.jsx?$' : ' babel-jest' ,
117
+ ' ^.+.tsx?$' : [
118
+ ' ts-jest' ,
119
+ {},
120
+ ],
121
+ },
122
+ }
123
+ "
124
+ ` ;
125
+
126
+ exports [` config migrate should generate transform config with existing transform options for js-with-ts 1` ] = `
127
+ "module.exports = {
128
+ transform : {
129
+ ' ^.+.[tj]sx?$' : [
130
+ ' ts-jest' ,
131
+ {},
132
+ ],
133
+ ' ^.+.tsx?$' : [
134
+ ' ts-jest' ,
135
+ {},
136
+ ],
122
137
},
123
- " preset" : " ts-jest/presets/js-with-babel"
124
138
}
125
139
"
126
140
` ;
127
141
128
142
exports [` config migrate should migrate preset if valid preset value is used 1` ] = `
143
+ ""jest": {
144
+ " transform" : {
145
+ " ^.+.tsx?$" : [
146
+ " ts-jest" ,
147
+ {}
148
+ ]
149
+ }
150
+ }
129
151
"
130
- No migration needed for given Jest configuration
131
- "
132
152
` ;
133
153
134
154
exports [` config migrate should migrate preset if valid preset value is used 2` ] = `
135
155
""jest": {
136
- " preset" : " ts-jest"
156
+ " transform" : {
157
+ " ^.+.tsx?$" : [
158
+ " ts-jest" ,
159
+ {}
160
+ ]
161
+ }
137
162
}
138
163
"
139
164
` ;
140
165
141
166
exports [` config migrate should migrate preset if valid preset value is used 3` ] = `
167
+ ""jest": {
168
+ " transform" : {
169
+ " ^.+.tsx?$" : [
170
+ " ts-jest" ,
171
+ {}
172
+ ]
173
+ }
174
+ }
142
175
"
143
- No migration needed for given Jest configuration
144
- "
145
176
` ;
146
177
147
178
exports [` config migrate should reset testMatch if testRegex is used 1` ] = `
148
179
""jest": {
149
180
" testRegex" : " foo-pattern" ,
150
- " preset" : " ts-jest"
181
+ " transform" : {
182
+ " ^.+.tsx?$" : [
183
+ " ts-jest" ,
184
+ {}
185
+ ]
186
+ }
151
187
}
152
188
"
153
189
` ;
@@ -157,7 +193,12 @@ exports[`config migrate should reset testMatch if testRegex is used 2`] = `
157
193
" testRegex" : [
158
194
" foo-pattern"
159
195
],
160
- " preset" : " ts-jest"
196
+ " transform" : {
197
+ " ^.+.tsx?$" : [
198
+ " ts-jest" ,
199
+ {}
200
+ ]
201
+ }
161
202
}
162
203
"
163
204
` ;
@@ -168,7 +209,12 @@ exports[`config migrate should reset testMatch if testRegex is used 3`] = `
168
209
" testMatch" : [
169
210
" **/__tests__/**/*.(spec|test).[tj]s?(x)"
170
211
],
171
- " preset" : " ts-jest"
212
+ " transform" : {
213
+ " ^.+.tsx?$" : [
214
+ " ts-jest" ,
215
+ {}
216
+ ]
217
+ }
172
218
}
173
219
"
174
220
` ;
@@ -178,15 +224,25 @@ exports[`config migrate should reset testMatch if testRegex is used 4`] = `
178
224
" testMatch" : [
179
225
" **/__tests__/**/*.(spec|test).[tj]s?(x)"
180
226
],
181
- " preset" : " ts-jest"
227
+ " transform" : {
228
+ " ^.+.tsx?$" : [
229
+ " ts-jest" ,
230
+ {}
231
+ ]
232
+ }
182
233
}
183
234
"
184
235
` ;
185
236
186
237
exports [` config migrate should reset testMatch if testRegex is used 5` ] = `
187
238
""jest": {
188
239
" testRegex" : " foo-pattern" ,
189
- " preset" : " ts-jest"
240
+ " transform" : {
241
+ " ^.+.tsx?$" : [
242
+ " ts-jest" ,
243
+ {}
244
+ ]
245
+ }
190
246
}
191
247
"
192
248
` ;
0 commit comments