@@ -376,7 +376,7 @@ describe('TsJestTransformer', () => {
376376 expect ( process . env . TS_JEST ) . toBe ( '1' )
377377 } )
378378
379- test . each ( [ 'foo.ts' , 'foo.tsx' ] ) ( 'should process ts/tsx file' , ( filePath ) => {
379+ test . each ( [ 'foo.ts' , 'foo.tsx' , 'foo.mts' , 'foo.mtsx' ] ) ( 'should process ts/tsx file' , ( filePath ) => {
380380 const fileContent = 'const foo = 1'
381381 const output = 'var foo = 1'
382382 tr . getCacheKey ( fileContent , filePath , baseTransformOptions )
@@ -391,30 +391,33 @@ describe('TsJestTransformer', () => {
391391 } )
392392 } )
393393
394- test . each ( [ 'foo.js' , 'foo.jsx' ] ) ( 'should process js/jsx file with allowJs true' , ( filePath ) => {
395- const fileContent = 'const foo = 1'
396- const output = 'var foo = 1'
397- const transformOptions = {
398- ...baseTransformOptions ,
399- config : {
400- ...baseTransformOptions . config ,
401- globals : {
402- 'ts-jest' : { tsconfig : { allowJs : true } } ,
394+ test . each ( [ 'foo.js' , 'foo.jsx' , 'foo.mjs' , 'foo.mjsx' ] ) (
395+ 'should process js/jsx file with allowJs true' ,
396+ ( filePath ) => {
397+ const fileContent = 'const foo = 1'
398+ const output = 'var foo = 1'
399+ const transformOptions = {
400+ ...baseTransformOptions ,
401+ config : {
402+ ...baseTransformOptions . config ,
403+ globals : {
404+ 'ts-jest' : { tsconfig : { allowJs : true } } ,
405+ } ,
403406 } ,
404- } ,
405- }
406- tr . getCacheKey ( fileContent , filePath , transformOptions )
407- logTarget . clear ( )
408- jest . spyOn ( TsJestCompiler . prototype , 'getCompiledOutput' ) . mockReturnValueOnce ( {
409- code : output ,
410- } )
407+ }
408+ tr . getCacheKey ( fileContent , filePath , transformOptions )
409+ logTarget . clear ( )
410+ jest . spyOn ( TsJestCompiler . prototype , 'getCompiledOutput' ) . mockReturnValueOnce ( {
411+ code : output ,
412+ } )
411413
412- const result = tr . process ( fileContent , filePath , transformOptions )
414+ const result = tr . process ( fileContent , filePath , transformOptions )
413415
414- expect ( result ) . toEqual ( {
415- code : output ,
416- } )
417- } )
416+ expect ( result ) . toEqual ( {
417+ code : output ,
418+ } )
419+ } ,
420+ )
418421
419422 test ( 'should process file with unknown extension and show warning message without babel-jest' , ( ) => {
420423 const fileContent = 'foo'
0 commit comments