Skip to content

Commit b207417

Browse files
committed
Add test for configFile error tolerance
1 parent 84386f9 commit b207417

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/harness/unittests/tsserverProjectSystem.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,5 +623,23 @@ namespace ts {
623623
checkNumberOfConfiguredProjects(projectService, 1);
624624
checkNumberOfInferredProjects(projectService, 0);
625625
});
626+
627+
it("should tolerate config file errors and still try to build a project", () => {
628+
const configFile: FileOrFolder = {
629+
path: "/a/b/tsconfig.json",
630+
content: `{
631+
"compilerOptions": {
632+
"target": "es6",
633+
"allowAnything": true
634+
},
635+
"someOtherProperty": {}
636+
}`
637+
};
638+
const host = new TestServerHost(/*useCaseSensitiveFileNames*/ false, getExecutingFilePathFromLibFile(libFile), "/", [commonFile1, commonFile2, libFile, configFile]);
639+
const projectService = new server.ProjectService(host, nullLogger);
640+
projectService.openClientFile(commonFile1.path);
641+
checkNumberOfConfiguredProjects(projectService, 1);
642+
checkConfiguredProjectRootFiles(projectService.configuredProjects[0], [commonFile1.path, commonFile2.path]);
643+
});
626644
});
627645
}

0 commit comments

Comments
 (0)