1- ' use strict' ;
1+ " use strict" ;
22
3- const path = require ( ' path' ) ;
4- const ts = require ( ' typescript' ) ;
3+ const path = require ( " path" ) ;
4+ const ts = require ( " typescript" ) ;
55
66const cwd = process . cwd ( ) ;
77const compilerOptions = loadCompilerOptions ( cwd ) || { } ;
8- const extensions = [ 'ts' , ' tsx' ] ;
8+ const extensions = [ "ts" , " tsx" ] ;
99if ( compilerOptions . allowJs ) {
10- extensions . push ( 'js' ) ;
11- extensions . push ( ' jsx' ) ;
10+ extensions . push ( "js" ) ;
11+ extensions . push ( " jsx" ) ;
1212}
1313
14- let testDir = ' test' ;
15- const packageData = require ( path . join ( cwd , ' package.json' ) ) ;
14+ let testDir = " test" ;
15+ const packageData = require ( path . join ( cwd , " package.json" ) ) ;
1616if (
1717 packageData &&
18- typeof packageData . directories === ' object' &&
19- typeof packageData . directories . test === ' string'
18+ typeof packageData . directories === " object" &&
19+ typeof packageData . directories . test === " string"
2020) {
2121 testDir = packageData . directories . test ;
2222}
23- const pattern = path . join ( testDir , `**/*.@(${ extensions . join ( '|' ) } )` ) ;
23+ const pattern = path . join ( testDir , `**/*.@(${ extensions . join ( "|" ) } )` ) ;
2424
25- require ( ' ./index' ) ( { cwd, pattern, extensions} ) ;
25+ require ( " ./index" ) ( { cwd, pattern, extensions } ) ;
2626
2727function loadCompilerOptions ( cwd ) {
2828 const tsconfigPath = ts . findConfigFile ( cwd , ts . sys . fileExists ) ;
@@ -35,7 +35,7 @@ function loadCompilerOptions(cwd) {
3535 }
3636 if ( result . config && result . config . compilerOptions ) {
3737 const basepath = path . dirname ( tsconfigPath ) ;
38- const { options} = ts . parseJsonConfigFileContent ( result . config , ts . sys , basepath ) ;
38+ const { options } = ts . parseJsonConfigFileContent ( result . config , ts . sys , basepath ) ;
3939 return options ;
4040 }
4141 return null ;
0 commit comments