@@ -608,6 +608,10 @@ declare module '@custom/plugin' {
608
608
path : "/a/b/test.ts" ,
609
609
content : "let x = 10"
610
610
} ;
611
+ const file3 : File = {
612
+ path : "/a/b/test2.ts" ,
613
+ content : "let xy = 10"
614
+ } ;
611
615
const configFile : File = {
612
616
path : "/a/b/tsconfig.json" ,
613
617
content : `{
@@ -618,9 +622,20 @@ declare module '@custom/plugin' {
618
622
"files": ["app.ts"]
619
623
}`
620
624
} ;
621
- const serverEventManager = new TestServerEventManager ( [ file , file2 , libFile , configFile ] ) ;
625
+ const serverEventManager = new TestServerEventManager ( [ file , file2 , file3 , libFile , configFile ] ) ;
622
626
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
623
633
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
+ ] ) ;
624
639
} ) ;
625
640
626
641
it ( "are not generated when the config file has errors but suppressDiagnosticEvents is true" , ( ) => {
@@ -651,16 +666,25 @@ declare module '@custom/plugin' {
651
666
path : "/a/b/test.ts" ,
652
667
content : "let x = 10"
653
668
} ;
669
+ const file3 : File = {
670
+ path : "/a/b/test2.ts" ,
671
+ content : "let xy = 10"
672
+ } ;
654
673
const configFile : File = {
655
674
path : "/a/b/tsconfig.json" ,
656
675
content : `{
657
676
"files": ["app.ts"]
658
677
}`
659
678
} ;
660
679
661
- const serverEventManager = new TestServerEventManager ( [ file , file2 , libFile , configFile ] ) ;
680
+ const serverEventManager = new TestServerEventManager ( [ file , file2 , file3 , libFile , configFile ] ) ;
662
681
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
663
685
serverEventManager . hasZeroEvent ( "configFileDiag" ) ;
686
+ openFilesForSession ( [ file3 ] , serverEventManager . session ) ;
687
+ serverEventManager . checkSingleConfigFileDiagEvent ( configFile . path , file3 . path , emptyArray ) ;
664
688
} ) ;
665
689
666
690
it ( "contains the project reference errors" , ( ) => {
0 commit comments