Skip to content

Commit a0e8e40

Browse files
author
easonLiangWorldedtech
committed
fix(test): reach the private disposeOnce with bracket notation
task.disposeOnce() is private, so the two new tests failed src-level tsc with TS2341. Bracket notation is the convention this repo uses for private members in tests. Local: src-level tsc --noEmit back to 62 = the worktree baseline; tails tests 2 passed.
1 parent dffa685 commit a0e8e40

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/core/task/__tests__/Task.spec.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4599,7 +4599,8 @@ describe("Cline", () => {
45994599
const cancelSpy = vi
46004600
.spyOn(task.diffViewProvider, "cancelPostSaveDiagnosticsTails")
46014601
.mockImplementation(() => {})
4602-
await task.disposeOnce()
4602+
// disposeOnce is private; bracket notation is the repo's convention for it.
4603+
await task["disposeOnce"]()
46034604
expect(cancelSpy).toHaveBeenCalledTimes(1)
46044605
})
46054606

@@ -4612,7 +4613,8 @@ describe("Cline", () => {
46124613
// The step after the cancel in the same teardown: if the throw escaped, this would
46134614
// never run and the HTTP request would keep streaming into a dead task.
46144615
const cancelRequestSpy = vi.spyOn(task, "cancelCurrentRequest").mockImplementation(() => {})
4615-
await task.disposeOnce()
4616+
// disposeOnce is private; bracket notation is the repo's convention for it.
4617+
await task["disposeOnce"]()
46164618
expect(cancelRequestSpy).toHaveBeenCalled()
46174619
expect(errorSpy).toHaveBeenCalledWith(
46184620
expect.stringContaining("Error cancelling post-save diagnostics tails:"),

0 commit comments

Comments
 (0)