@@ -608,6 +608,10 @@ declare module '@custom/plugin' {
608608 path : "/a/b/test.ts" ,
609609 content : "let x = 10"
610610 } ;
611+ const file3 : File = {
612+ path : "/a/b/test2.ts" ,
613+ content : "let xy = 10"
614+ } ;
611615 const configFile : File = {
612616 path : "/a/b/tsconfig.json" ,
613617 content : `{
@@ -618,9 +622,20 @@ declare module '@custom/plugin' {
618622 "files": ["app.ts"]
619623 }`
620624 } ;
621- const serverEventManager = new TestServerEventManager ( [ file , file2 , libFile , configFile ] ) ;
625+ const serverEventManager = new TestServerEventManager ( [ file , file2 , file3 , libFile , configFile ] ) ;
622626 openFilesForSession ( [ file2 ] , serverEventManager . session ) ;
627+ serverEventManager . checkSingleConfigFileDiagEvent ( configFile . path , file2 . path , [
628+ getUnknownCompilerOptionDiagnostic ( configFile , "foo" ) ,
629+ getUnknownCompilerOptionDiagnostic ( configFile , "allowJS" , "allowJs" )
630+ ] ) ;
631+ openFilesForSession ( [ file ] , serverEventManager . session ) ;
632+ // We generate only if project is created when opening file from the project
623633 serverEventManager . hasZeroEvent ( "configFileDiag" ) ;
634+ openFilesForSession ( [ file3 ] , serverEventManager . session ) ;
635+ serverEventManager . checkSingleConfigFileDiagEvent ( configFile . path , file3 . path , [
636+ getUnknownCompilerOptionDiagnostic ( configFile , "foo" ) ,
637+ getUnknownCompilerOptionDiagnostic ( configFile , "allowJS" , "allowJs" )
638+ ] ) ;
624639 } ) ;
625640
626641 it ( "are not generated when the config file has errors but suppressDiagnosticEvents is true" , ( ) => {
@@ -651,16 +666,25 @@ declare module '@custom/plugin' {
651666 path : "/a/b/test.ts" ,
652667 content : "let x = 10"
653668 } ;
669+ const file3 : File = {
670+ path : "/a/b/test2.ts" ,
671+ content : "let xy = 10"
672+ } ;
654673 const configFile : File = {
655674 path : "/a/b/tsconfig.json" ,
656675 content : `{
657676 "files": ["app.ts"]
658677 }`
659678 } ;
660679
661- const serverEventManager = new TestServerEventManager ( [ file , file2 , libFile , configFile ] ) ;
680+ const serverEventManager = new TestServerEventManager ( [ file , file2 , file3 , libFile , configFile ] ) ;
662681 openFilesForSession ( [ file2 ] , serverEventManager . session ) ;
682+ serverEventManager . checkSingleConfigFileDiagEvent ( configFile . path , file2 . path , emptyArray ) ;
683+ openFilesForSession ( [ file ] , serverEventManager . session ) ;
684+ // We generate only if project is created when opening file from the project
663685 serverEventManager . hasZeroEvent ( "configFileDiag" ) ;
686+ openFilesForSession ( [ file3 ] , serverEventManager . session ) ;
687+ serverEventManager . checkSingleConfigFileDiagEvent ( configFile . path , file3 . path , emptyArray ) ;
664688 } ) ;
665689
666690 it ( "contains the project reference errors" , ( ) => {
0 commit comments