Skip to content

Commit afe36be

Browse files
authored
Add test for #11980 (#12027)
* add test for the fix for overwrite emitting error * cr feedback
1 parent 7d1f0e6 commit afe36be

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/harness/unittests/tsserverProjectSystem.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,4 +2464,28 @@ namespace ts.projectSystem {
24642464

24652465
});
24662466
});
2467+
2468+
describe("No overwrite emit error", () => {
2469+
it("for inferred project", () => {
2470+
const f1 = {
2471+
path: "/a/b/f1.js",
2472+
content: "function test1() { }"
2473+
};
2474+
const host = createServerHost([f1, libFile]);
2475+
const session = createSession(host);
2476+
openFilesForSession([f1], session);
2477+
2478+
const projectService = session.getProjectService();
2479+
checkNumberOfProjects(projectService, { inferredProjects: 1 });
2480+
const projectName = projectService.inferredProjects[0].getProjectName();
2481+
2482+
const diags = session.executeCommand(<server.protocol.CompilerOptionsDiagnosticsRequest>{
2483+
type: "request",
2484+
command: server.CommandNames.CompilerOptionsDiagnosticsFull,
2485+
seq: 2,
2486+
arguments: { projectFileName: projectName }
2487+
}).response;
2488+
assert.isTrue(diags.length === 0);
2489+
});
2490+
});
24672491
}

0 commit comments

Comments
 (0)