Add dynamic file open test

This commit is contained in:
Benjamin Lichtman
2017-12-27 13:44:51 -08:00
parent d4dd930f2e
commit 90e11f0797
@@ -1184,6 +1184,28 @@ namespace ts.projectSystem {
checkNumberOfInferredProjects(projectService, 0);
});
it("external project for dynamic file", () => {
const file1 = {
path: "/a/b/f1.ts",
content: "let x =1;"
};
const externalProjectName = "^ScriptDocument1 file1.ts";
const externalFiles = toExternalFiles(["^ScriptDocument1 file1.ts"]);
const host = createServerHost([file1]);
const projectService = createProjectService(host);
projectService.openExternalProject({
rootFiles: externalFiles,
options: {},
projectFileName: externalProjectName
});
checkNumberOfExternalProjects(projectService, 1);
checkNumberOfInferredProjects(projectService, 0);
externalFiles[0].content = "let x =1;";
projectService.applyChangesInOpenFiles(externalFiles, [], []);
});
it("external project that included config files", () => {
const file1 = {
path: "/a/b/f1.ts",