Skip to content

Commit 82ef158

Browse files
committed
test: clarify openresponses stream assertions
1 parent 9bd8ee0 commit 82ef158

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/gateway/openresponses-http.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ describe("OpenResponses HTTP API (e2e)", () => {
719719
expect(eventTypes).toContain("response.output_text.done");
720720
expect(eventTypes).toContain("response.content_part.done");
721721
expect(eventTypes).toContain("response.completed");
722-
expect(deltaEvents.some((e) => e.data === "[DONE]")).toBe(true);
722+
expect(deltaEvents.map((event) => event.data)).toContain("[DONE]");
723723

724724
const deltas = deltaEvents
725725
.filter((e) => e.event === "response.output_text.delta")
@@ -831,7 +831,7 @@ describe("OpenResponses HTTP API (e2e)", () => {
831831
| undefined;
832832
expect(streamingOpts?.senderIsOwner).toBe(true);
833833
const streamingEvents = parseSseEvents(await streamingResponse.text());
834-
expect(streamingEvents.some((event) => event.event === "response.completed")).toBe(true);
834+
expect(streamingEvents.map((event) => event.event)).toContain("response.completed");
835835
});
836836

837837
it("treats shared-secret bearer callers as owner operators", async () => {
@@ -950,7 +950,7 @@ describe("OpenResponses HTTP API (e2e)", () => {
950950
?.text as string | undefined) ?? "",
951951
).toBe("Let me check that.");
952952
expect(response?.output?.[1]?.name).toBe("get_weather");
953-
expect(events.some((event) => event.data === "[DONE]")).toBe(true);
953+
expect(events.map((event) => event.data)).toContain("[DONE]");
954954
});
955955

956956
it("returns every client tool call when an agent invokes multiple tools in one turn (#52288)", async () => {
@@ -1095,7 +1095,7 @@ describe("OpenResponses HTTP API (e2e)", () => {
10951095
"activate_graph",
10961096
"get_status",
10971097
]);
1098-
expect(events.some((event) => event.data === "[DONE]")).toBe(true);
1098+
expect(events.map((event) => event.data)).toContain("[DONE]");
10991099
});
11001100

11011101
it("reuses the prior session when previous_response_id is provided", async () => {

0 commit comments

Comments
 (0)