@@ -1071,13 +1071,53 @@ func TestTscExtends(t *testing.T) {
10711071 edits : edits ,
10721072 }
10731073 }
1074+ getTscExtendsNonStringPathTestCase := func (propertyName string ) * tscInput {
1075+ return & tscInput {
1076+ subScenario : "extends config with non-string " + propertyName ,
1077+ files : FileMap {
1078+ "/home/src/projects/project/tsconfig.json" : stringtestutil .Dedent (`
1079+ {
1080+ "extends": "./base.json",
1081+ }` ),
1082+ "/home/src/projects/project/base.json" : stringtestutil .Dedent (`
1083+ {
1084+ "` + propertyName + `": [1],
1085+ }` ),
1086+ "/home/src/projects/project/main.ts" : `export const x = 1;` ,
1087+ },
1088+ cwd : "/home/src/projects/project" ,
1089+ commandLineArgs : []string {"-p" , "tsconfig.json" , "--pretty" , "false" },
1090+ }
1091+ }
1092+ getTscExtendsBase := func (baseContents string ) FileMap {
1093+ return FileMap {
1094+ "/home/src/projects/project/tsconfig.json" : stringtestutil .Dedent (`
1095+ {
1096+ "extends": "./base.json",
1097+ }` ),
1098+ "/home/src/projects/project/base.json" : stringtestutil .Dedent (baseContents ),
1099+ "/home/src/projects/project/main.ts" : `export const x = 1;` ,
1100+ }
1101+ }
10741102 testCases := []* tscInput {
10751103 {
10761104 subScenario : "when building solution with projects extends config with include" ,
10771105 files : getBuildConfigFileExtendsFileMap (),
10781106 cwd : "/home/src/workspaces/solution" ,
10791107 commandLineArgs : []string {"--b" , "--v" , "--listFiles" },
10801108 },
1109+ getTscExtendsNonStringPathTestCase ("include" ),
1110+ getTscExtendsNonStringPathTestCase ("exclude" ),
1111+ getTscExtendsNonStringPathTestCase ("files" ),
1112+ {
1113+ subScenario : "extends config with mixed valid and non-string include" ,
1114+ files : getTscExtendsBase (`
1115+ {
1116+ "include": ["main.ts", 1],
1117+ }` ),
1118+ cwd : "/home/src/projects/project" ,
1119+ commandLineArgs : []string {"-p" , "tsconfig.json" , "--pretty" , "false" },
1120+ },
10811121 {
10821122 subScenario : "when building project uses reference and both extend config with include" ,
10831123 files : getBuildConfigFileExtendsFileMap (),
0 commit comments