Skip to content

Commit 2035118

Browse files
CCR 4
Update joinSession onPermissionRequest tests to spy on resumeSessionForExtension (the method joinSession now calls to thread factories). The old spy on resumeSession no longer intercepts, so the real method ran and hung to a 30s timeout once the prettier gate stopped short-circuiting the suite.
1 parent 83b06fc commit 2035118

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

nodejs/test/extension.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ describe("joinSession", () => {
1818

1919
it("defaults onPermissionRequest to no-result", async () => {
2020
process.env.SESSION_ID = "session-123";
21-
const resumeSession = vi
22-
.spyOn(CopilotClient.prototype, "resumeSession")
21+
const resumeForExtension = vi
22+
.spyOn(CopilotClient.prototype, "resumeSessionForExtension")
2323
.mockResolvedValue({} as any);
2424

2525
await joinSession({ tools: [] });
2626

27-
const [, config] = resumeSession.mock.calls[0]!;
27+
const [, config] = resumeForExtension.mock.calls[0]!;
2828
expect(config.onPermissionRequest).toBeDefined();
2929
expect(config.onPermissionRequest).toBe(defaultJoinSessionPermissionHandler);
3030
const result = await Promise.resolve(
@@ -36,13 +36,13 @@ describe("joinSession", () => {
3636

3737
it("preserves an explicit onPermissionRequest handler", async () => {
3838
process.env.SESSION_ID = "session-123";
39-
const resumeSession = vi
40-
.spyOn(CopilotClient.prototype, "resumeSession")
39+
const resumeForExtension = vi
40+
.spyOn(CopilotClient.prototype, "resumeSessionForExtension")
4141
.mockResolvedValue({} as any);
4242

4343
await joinSession({ onPermissionRequest: approveAll, suppressResumeEvent: false });
4444

45-
const [, config] = resumeSession.mock.calls[0]!;
45+
const [, config] = resumeForExtension.mock.calls[0]!;
4646
expect(config.onPermissionRequest).toBe(approveAll);
4747
expect(config.suppressResumeEvent).toBe(false);
4848
});

0 commit comments

Comments
 (0)