@@ -981,6 +981,59 @@ func TestTscExtends(t *testing.T) {
981981 }
982982}
983983
984+ func TestTscIgnoreConfig (t * testing.T ) {
985+ t .Parallel ()
986+ filesWithoutConfig := func () FileMap {
987+ return FileMap {
988+ "/home/src/workspaces/project/src/a.ts" : "export const a = 10;" ,
989+ "/home/src/workspaces/project/src/b.ts" : "export const b = 10;" ,
990+ "/home/src/workspaces/project/c.ts" : "export const c = 10;" ,
991+ }
992+ }
993+ filesWithConfig := func () FileMap {
994+ files := filesWithoutConfig ()
995+ files ["/home/src/workspaces/project/tsconfig.json" ] = stringtestutil .Dedent (`
996+ {
997+ "include": ["src"],
998+ }` )
999+ return files
1000+ }
1001+ getScenarios := func (subScenario string , commandLineArgs []string ) []* tscInput {
1002+ commandLineArgsIgnoreConfig := append (commandLineArgs , "--ignoreConfig" )
1003+ return []* tscInput {
1004+ {
1005+ subScenario : subScenario ,
1006+ files : filesWithConfig (),
1007+ commandLineArgs : commandLineArgs ,
1008+ },
1009+ {
1010+ subScenario : subScenario + " with --ignoreConfig" ,
1011+ files : filesWithConfig (),
1012+ commandLineArgs : commandLineArgsIgnoreConfig ,
1013+ },
1014+ {
1015+ subScenario : subScenario + " when config file absent" ,
1016+ files : filesWithoutConfig (),
1017+ commandLineArgs : commandLineArgs ,
1018+ },
1019+ {
1020+ subScenario : subScenario + " when config file absent with --ignoreConfig" ,
1021+ files : filesWithoutConfig (),
1022+ commandLineArgs : commandLineArgsIgnoreConfig ,
1023+ },
1024+ }
1025+ }
1026+ testCases := slices .Concat (
1027+ getScenarios ("without any options" , nil ),
1028+ getScenarios ("specifying files" , []string {"src/a.ts" }),
1029+ getScenarios ("specifying project" , []string {"-p" , "." }),
1030+ getScenarios ("mixing project and files" , []string {"-p" , "." , "src/a.ts" , "c.ts" }),
1031+ )
1032+ for _ , test := range testCases {
1033+ test .run (t , "ignoreConfig" )
1034+ }
1035+ }
1036+
9841037func TestTscIncremental (t * testing.T ) {
9851038 t .Parallel ()
9861039 getConstEnumTest := func (bdsContents string , changeEnumFile string , testSuffix string ) * tscInput {
0 commit comments