Skip to content

Commit 3147f3a

Browse files
committed
fix: drift test assertions — use prefix match for Malformed JSON error message
1 parent b9b4edc commit 3147f3a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/__tests__/drift/openai-chat.drift.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ describe("OpenAI Chat Completions error shapes", () => {
321321

322322
const body = JSON.parse(res.body);
323323
expect(body.error).toBeDefined();
324-
expect(body.error.message).toBe("Malformed JSON");
324+
expect(body.error.message).toMatch(/^Malformed JSON/);
325325
expect(body.error.type).toBe("invalid_request_error");
326326
expect(body.error.code).toBe("invalid_json");
327327

src/__tests__/drift/openai-responses.drift.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ describe("OpenAI Responses API error shapes", () => {
304304
).toEqual([]);
305305

306306
// Verify concrete values
307-
expect(body.error.message).toBe("Malformed JSON");
307+
expect(body.error.message).toMatch(/^Malformed JSON/);
308308
expect(body.error.type).toBe("invalid_request_error");
309309
expect(body.error.code).toBe("invalid_json");
310310
});

0 commit comments

Comments
 (0)