Skip to content

Commit 059b6fd

Browse files
authored
fix: drift test assertions for Malformed JSON detail (#181)
## Summary - Update 2 drift test assertions from exact .toBe() to prefix .toMatch() for the Malformed JSON error message - PR #177/#178 intentionally changed the error format to include parse error details, but the drift test assertions weren't updated ## Test plan - [x] Drift tests pass locally
2 parents b9b4edc + 3147f3a commit 059b6fd

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)