@@ -307,30 +307,30 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
307307 )
308308 const res = await runCli ( ...noOption , pkgPaths . current )
309309 expect ( res ) . toMatchInlineSnapshot ( `
310- Object {
311- "exitCode": 0,
312- "log": "",
313- "stderr": "
314- Migrated Jest configuration:
315-
316-
317- Detected preset 'default' as the best matching preset for your configuration.
318- Visit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more information about presets.
319-
320- ",
321- "stdout": "\\"jest\\": {
322- \\"globals\\": {
323- \\"ts-jest\\": {
324- \\"tsconfig\\": {
325- \\"target\\": \\"es6\\"
326- }
327- }
328- },
329- \\"preset\\": \\"ts-jest\\"
330- }
331- ",
332- }
333- `)
310+ Object {
311+ "exitCode": 0,
312+ "log": "",
313+ "stderr": "
314+ Migrated Jest configuration:
315+
316+
317+ Detected preset 'default' as the best matching preset for your configuration.
318+ Visit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more information about presets.
319+
320+ ",
321+ "stdout": "\\"jest\\": {
322+ \\"globals\\": {
323+ \\"ts-jest\\": {
324+ \\"tsconfig\\": {
325+ \\"target\\": \\"es6\\"
326+ }
327+ }
328+ },
329+ \\"preset\\": \\"ts-jest\\"
330+ }
331+ ",
332+ }
333+ ` )
334334 expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( )
335335 } )
336336
@@ -346,24 +346,24 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
346346 )
347347 const res = await runCli ( ...fullOptions , pkgPaths . current )
348348 expect ( res ) . toMatchInlineSnapshot ( `
349- Object {
350- "exitCode": 0,
351- "log": "",
352- "stderr": "
353- Migrated Jest configuration:
354- ",
355- "stdout": "\\"jest\\": {
356- \\"globals\\": {
357- \\"ts-jest\\": {
358- \\"tsconfig\\": {
359- \\"target\\": \\"es6\\"
360- }
361- }
362- }
363- }
364- ",
365- }
366- `)
349+ Object {
350+ "exitCode": 0,
351+ "log": "",
352+ "stderr": "
353+ Migrated Jest configuration:
354+ ",
355+ "stdout": "\\"jest\\": {
356+ \\"globals\\": {
357+ \\"ts-jest\\": {
358+ \\"tsconfig\\": {
359+ \\"target\\": \\"es6\\"
360+ }
361+ }
362+ }
363+ }
364+ ",
365+ }
366+ ` )
367367 expect ( fs . writeFileSync ) . not . toHaveBeenCalled ( )
368368 } )
369369
@@ -388,29 +388,29 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
388388 )
389389 const res = await runCli ( ...noOption , pkgPaths . current )
390390 expect ( res . stdout ) . toMatchInlineSnapshot ( `
391- "\\"jest\\": {
392- \\"globals\\": {
393- \\"ts-jest\\": {
394- \\"tsconfig\\": {
395- \\"target\\": \\"es6\\"
396- }
397- }
398- },
399- \\"moduleFileExtensions\\": [
400- \\"js\\",
401- \\"ts\\",
402- \\"tsx\\"
403- ],
404- \\"testMatch\\": [
405- \\"**/?(*.)+(spec|test).js?(x)\\",
406- \\"**/?(*.)+(spec|test).ts?(x)\\",
407- \\"**/__tests__/**/*.js?(x)\\",
408- \\"**/__tests__/**/*.ts?(x)\\"
409- ],
410- \\"preset\\": \\"ts-jest\\"
411- }
412- "
413- `)
391+ "\\"jest\\": {
392+ \\"globals\\": {
393+ \\"ts-jest\\": {
394+ \\"tsconfig\\": {
395+ \\"target\\": \\"es6\\"
396+ }
397+ }
398+ },
399+ \\"moduleFileExtensions\\": [
400+ \\"js\\",
401+ \\"ts\\",
402+ \\"tsx\\"
403+ ],
404+ \\"testMatch\\": [
405+ \\"**/?(*.)+(spec|test).js?(x)\\",
406+ \\"**/?(*.)+(spec|test).ts?(x)\\",
407+ \\"**/__tests__/**/*.js?(x)\\",
408+ \\"**/__tests__/**/*.ts?(x)\\"
409+ ],
410+ \\"preset\\": \\"ts-jest\\"
411+ }
412+ "
413+ ` )
414414 } )
415415
416416 it ( 'should reset testMatch if testRegex is used' , async ( ) => {
@@ -427,13 +427,13 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
427427 )
428428 const res = await runCli ( ...noOption , pkgPaths . current )
429429 expect ( res . stdout ) . toMatchInlineSnapshot ( `
430- "\\"jest\\": {
431- \\"testRegex\\": \\"foo-pattern\\",
432- \\"preset\\": \\"ts-jest\\",
433- \\"testMatch\\": null
434- }
435- "
436- `)
430+ "\\"jest\\": {
431+ \\"testRegex\\": \\"foo-pattern\\",
432+ \\"preset\\": \\"ts-jest\\",
433+ \\"testMatch\\": null
434+ }
435+ "
436+ ` )
437437 } )
438438
439439 it ( 'should detect best preset' , async ( ) => {
@@ -445,43 +445,43 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
445445 jest . doMock ( pkgPaths . nextCfg , ( ) => ( { } ) , { virtual : true } )
446446 let res = await runCli ( ...noOption , pkgPaths . currentCfg )
447447 expect ( res . stdout ) . toMatchInlineSnapshot ( `
448- "module.exports = {
449- preset: 'ts-jest',
450- }
451- "
452- `)
448+ "module.exports = {
449+ preset: 'ts-jest',
450+ }
451+ "
452+ ` )
453453
454454 // js-with-ts from args
455455 jest . doMock ( pkgPaths . nextCfg , ( ) => ( { } ) , { virtual : true } )
456456 res = await runCli ( ...noOption , '--allow-js' , pkgPaths . currentCfg )
457457 expect ( res . stdout ) . toMatchInlineSnapshot ( `
458- "module.exports = {
459- preset: 'ts-jest/presets/js-with-ts',
460- }
461- "
462- `)
458+ "module.exports = {
459+ preset: 'ts-jest/presets/js-with-ts',
460+ }
461+ "
462+ ` )
463463
464464 // js-with-ts from previous transform
465465 jest . doMock ( pkgPaths . nextCfg , ( ) => ( { transform : { '^.+\\.[tj]sx?$' : 'ts-jest' } } ) , { virtual : true } )
466466 res = await runCli ( ...noOption , pkgPaths . currentCfg )
467467 expect ( res . stdout ) . toMatchInlineSnapshot ( `
468- "module.exports = {
469- preset: 'ts-jest/presets/js-with-ts',
470- }
471- "
472- `)
468+ "module.exports = {
469+ preset: 'ts-jest/presets/js-with-ts',
470+ }
471+ "
472+ ` )
473473
474474 // js-with-babel from previous transform
475475 jest . doMock ( pkgPaths . nextCfg , ( ) => ( { transform : { '^.+\\.jsx?$' : 'babel-jest' , '^.+\\.tsx?$' : 'ts-jest' } } ) , {
476476 virtual : true ,
477477 } )
478478 res = await runCli ( ...noOption , pkgPaths . currentCfg )
479479 expect ( res . stdout ) . toMatchInlineSnapshot ( `
480- "module.exports = {
481- preset: 'ts-jest/presets/js-with-babel',
482- }
483- "
484- `)
480+ "module.exports = {
481+ preset: 'ts-jest/presets/js-with-babel',
482+ }
483+ "
484+ ` )
485485
486486 // defaults when previous transform is ambiguous
487487 jest . doMock (
@@ -491,15 +491,15 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
491491 )
492492 res = await runCli ( ...noOption , pkgPaths . currentCfg )
493493 expect ( res . stdout ) . toMatchInlineSnapshot ( `
494- "module.exports = {
495- transform: {
496- '^src/js/.+\\\\\\\\.jsx?$': 'babel-jest',
497- '^src/ts/.+\\\\\\\\.tsx?$': 'ts-jest',
498- },
499- preset: 'ts-jest',
500- }
501- "
502- `)
494+ "module.exports = {
495+ transform: {
496+ '^src/js/.+\\\\\\\\.jsx?$': 'babel-jest',
497+ '^src/ts/.+\\\\\\\\.tsx?$': 'ts-jest',
498+ },
499+ preset: 'ts-jest',
500+ }
501+ "
502+ ` )
503503 } )
504504
505505 it ( 'should normalize transform values' , async ( ) => {
@@ -520,16 +520,16 @@ Jest configuration written to "${normalize('/foo/bar/package.json')}".
520520 )
521521 const res = await runCli ( ...noOption , pkgPaths . current )
522522 expect ( res . stdout ) . toMatchInlineSnapshot ( `
523- "\\"jest\\": {
524- \\"transform\\": {
525- \\"<rootDir>/src/.+\\\\\\\\.[jt]s$\\": \\"ts-jest\\",
526- \\"foo\\\\\\\\.ts\\": \\"ts-jest\\",
527- \\"bar\\\\\\\\.ts\\": \\"ts-jest\\"
528- },
529- \\"preset\\": \\"ts-jest\\"
530- }
531- "
532- `)
523+ "\\"jest\\": {
524+ \\"transform\\": {
525+ \\"<rootDir>/src/.+\\\\\\\\.[jt]s$\\": \\"ts-jest\\",
526+ \\"foo\\\\\\\\.ts\\": \\"ts-jest\\",
527+ \\"bar\\\\\\\\.ts\\": \\"ts-jest\\"
528+ },
529+ \\"preset\\": \\"ts-jest\\"
530+ }
531+ "
532+ ` )
533533 } )
534534
535535 it ( 'should output help' , async ( ) => {
0 commit comments