Skip to content

Commit 3495221

Browse files
committed
Fix Node.js context test: avoid sendAndWait timeout
The E2E test proxy doesn't have a cached response for the new test. Use createSession + getMessages instead of sendAndWait to avoid needing a CAPI proxy response.
1 parent d6d22df commit 3495221

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nodejs/test/e2e/session.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ describe("Sessions", async () => {
2323
});
2424

2525
it("should list sessions with context field", async () => {
26-
// Create a new session and send a message to persist it
26+
// Create a session — just creating it is enough for it to appear in listSessions
2727
const session = await client.createSession();
2828
expect(session.sessionId).toMatch(/^[a-f0-9-]+$/);
29-
await session.sendAndWait({ prompt: "Say hello" });
3029

31-
// Wait for session file to be flushed to disk
32-
await new Promise((resolve) => setTimeout(resolve, 500));
30+
// Verify it has a start event (confirms session is active)
31+
const messages = await session.getMessages();
32+
expect(messages.length).toBeGreaterThan(0);
3333

3434
// List sessions and find the one we just created
3535
const sessions = await client.listSessions();

0 commit comments

Comments
 (0)