@@ -199,7 +199,7 @@ describe('customTransformers', () => {
199199 } as any ,
200200 logger,
201201 tsJestConfig : {
202- astTransformers : [ 'dummy-transformer' ] ,
202+ astTransformers : [ '<rootDir>/__mocks__/ dummy-transformer' ] ,
203203 } ,
204204 resolve : null ,
205205 } ) . customTransformers ,
@@ -241,7 +241,7 @@ describe('babelJestTransformer', () => {
241241 expect ( babelJest ) . toBeUndefined ( )
242242 } )
243243
244- it ( 'should return babelJestTransformer with babalConfig is true' , ( ) => {
244+ it ( 'should return babelJestTransformer with babelConfig is true' , ( ) => {
245245 const cs = createConfigSet ( {
246246 jestConfig : {
247247 rootDir : 'src' ,
@@ -265,15 +265,24 @@ describe('babelJestTransformer', () => {
265265 expect ( typeof babelJest . process ) . toBe ( 'function' )
266266 } )
267267
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 ) => {
270278 const cs = createConfigSet ( {
271279 jestConfig : {
272280 globals : {
273281 'ts-jest' : {
274- babelConfig : FILE ,
282+ babelConfig : data . path ,
275283 } ,
276284 } ,
285+ rootDir : data . rootDir ,
277286 } ,
278287 resolve : null ,
279288 } )
0 commit comments