@@ -471,7 +471,7 @@ describe('ts-node', function () {
471471 const BIN_EXEC = `"${ BIN_PATH } " --project tests/tsconfig-options/tsconfig.json`
472472
473473 it ( 'should override compiler options from env' , function ( done ) {
474- exec ( `${ BIN_EXEC } tests/tsconfig-options/log-options .js` , {
474+ exec ( `${ BIN_EXEC } tests/tsconfig-options/log-options1 .js` , {
475475 env : {
476476 ...process . env ,
477477 TS_NODE_COMPILER_OPTIONS : '{"typeRoots": ["env-typeroots"]}'
@@ -485,35 +485,38 @@ describe('ts-node', function () {
485485 } )
486486
487487 it ( 'should use options from `tsconfig.json`' , function ( done ) {
488- exec ( `${ BIN_EXEC } tests/tsconfig-options/log-options .js` , function ( err , stdout ) {
488+ exec ( `${ BIN_EXEC } tests/tsconfig-options/log-options1 .js` , function ( err , stdout ) {
489489 expect ( err ) . to . equal ( null )
490490 const { options, config } = JSON . parse ( stdout )
491491 expect ( config . options . typeRoots ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/tsconfig-typeroots' ) . replace ( / \\ / g, '/' ) ] )
492492 expect ( config . options . types ) . to . deep . equal ( [ 'tsconfig-tsnode-types' ] )
493493 expect ( options . pretty ) . to . equal ( undefined )
494494 expect ( options . skipIgnore ) . to . equal ( false )
495495 expect ( options . transpileOnly ) . to . equal ( true )
496- expect ( options . require ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/required .js' ) ] )
496+ expect ( options . require ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/required1 .js' ) ] )
497497 return done ( )
498498 } )
499499 } )
500500
501- it ( 'should have flags override `tsconfig.json`' , function ( done ) {
502- exec ( `${ BIN_EXEC } --skip-ignore --compiler-options "{\\"types\\":[\\"flags-types\\"]}" tests/tsconfig-options/log -options.js` , function ( err , stdout ) {
501+ it ( 'should have flags override / merge with `tsconfig.json`' , function ( done ) {
502+ exec ( `${ BIN_EXEC } --skip-ignore --compiler-options "{\\"types\\":[\\"flags-types\\"]}" --require ./ tests/tsconfig-options/required2.js tests/tsconfig -options/log-options2 .js` , function ( err , stdout ) {
503503 expect ( err ) . to . equal ( null )
504504 const { options, config } = JSON . parse ( stdout )
505505 expect ( config . options . typeRoots ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/tsconfig-typeroots' ) . replace ( / \\ / g, '/' ) ] )
506506 expect ( config . options . types ) . to . deep . equal ( [ 'flags-types' ] )
507507 expect ( options . pretty ) . to . equal ( undefined )
508508 expect ( options . skipIgnore ) . to . equal ( true )
509509 expect ( options . transpileOnly ) . to . equal ( true )
510- expect ( options . require ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/required.js' ) ] )
510+ expect ( options . require ) . to . deep . equal ( [
511+ join ( __dirname , '../tests/tsconfig-options/required1.js' ) ,
512+ './tests/tsconfig-options/required2.js'
513+ ] )
511514 return done ( )
512515 } )
513516 } )
514517
515518 it ( 'should have `tsconfig.json` override environment' , function ( done ) {
516- exec ( `${ BIN_EXEC } tests/tsconfig-options/log-options .js` , {
519+ exec ( `${ BIN_EXEC } tests/tsconfig-options/log-options1 .js` , {
517520 env : {
518521 ...process . env ,
519522 TS_NODE_PRETTY : 'true' ,
@@ -527,7 +530,7 @@ describe('ts-node', function () {
527530 expect ( options . pretty ) . to . equal ( true )
528531 expect ( options . skipIgnore ) . to . equal ( false )
529532 expect ( options . transpileOnly ) . to . equal ( true )
530- expect ( options . require ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/required .js' ) ] )
533+ expect ( options . require ) . to . deep . equal ( [ join ( __dirname , '../tests/tsconfig-options/required1 .js' ) ] )
531534 return done ( )
532535 } )
533536 } )
0 commit comments