@@ -199,7 +199,7 @@ describe('customTransformers', () => {
199
199
} as any ,
200
200
logger,
201
201
tsJestConfig : {
202
- astTransformers : [ 'dummy-transformer' ] ,
202
+ astTransformers : [ '<rootDir>/__mocks__/ dummy-transformer' ] ,
203
203
} ,
204
204
resolve : null ,
205
205
} ) . customTransformers ,
@@ -241,7 +241,7 @@ describe('babelJestTransformer', () => {
241
241
expect ( babelJest ) . toBeUndefined ( )
242
242
} )
243
243
244
- it ( 'should return babelJestTransformer with babalConfig is true' , ( ) => {
244
+ it ( 'should return babelJestTransformer with babelConfig is true' , ( ) => {
245
245
const cs = createConfigSet ( {
246
246
jestConfig : {
247
247
rootDir : 'src' ,
@@ -265,15 +265,24 @@ describe('babelJestTransformer', () => {
265
265
expect ( typeof babelJest . process ) . toBe ( 'function' )
266
266
} )
267
267
268
- it ( 'should return babelJestTransformer with non javascript file path' , ( ) => {
269
- const FILE = 'src/__mocks__/.babelrc-foo'
268
+ it . each ( [
269
+ {
270
+ path : 'src/__mocks__/.babelrc-foo' ,
271
+ rootDir : './' ,
272
+ } ,
273
+ {
274
+ path : '<rootDir>/.babelrc-foo' ,
275
+ rootDir : 'src/__mocks__/' ,
276
+ } ,
277
+ ] ) ( 'should return babelJestTransformer with non javascript file path' , ( data ) => {
270
278
const cs = createConfigSet ( {
271
279
jestConfig : {
272
280
globals : {
273
281
'ts-jest' : {
274
- babelConfig : FILE ,
282
+ babelConfig : data . path ,
275
283
} ,
276
284
} ,
285
+ rootDir : data . rootDir ,
277
286
} ,
278
287
resolve : null ,
279
288
} )
0 commit comments