Skip to content

Commit 5395d0d

Browse files
committed
Add test
1 parent 5830bb9 commit 5395d0d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/harness/unittests/tsserverProjectSystem.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,26 @@ namespace ts.projectSystem {
14961496
}
14971497
});
14981498

1499+
it("ignores files excluded by a legacy safe type list", () => {
1500+
const file1 = {
1501+
path: "/a/b/bliss.js",
1502+
content: "let x = 5"
1503+
};
1504+
const file2 = {
1505+
path: "/a/b/foo.js",
1506+
content: ""
1507+
};
1508+
const host = createServerHost([file1, file2, customTypesMap]);
1509+
const projectService = createProjectService(host);
1510+
try {
1511+
projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]), typeAcquisition: { enable: true } });
1512+
const proj = projectService.externalProjects[0];
1513+
assert.deepEqual(proj.getFileNames(), [file2.path]);
1514+
} finally {
1515+
projectService.resetSafeList();
1516+
}
1517+
});
1518+
14991519
it("open file become a part of configured project if it is referenced from root file", () => {
15001520
const file1 = {
15011521
path: "/a/b/f1.ts",

0 commit comments

Comments
 (0)