fix(moderation): improve error handling for malformed JSON responses and ensure proper response headers

This commit is contained in:
MythEclipse committed 2026-05-21 04:00:36 +07:00
1 parent 8884e29ce7
commit f851ea0fa9
2 files changed
+13 -4

No files matched your search

@@ -540,6 +540,8 @@ describe("runModerationAnalysis", () => {
global.fetch = vi.fn().mockResolvedValue({
ok: true,
status: 200,
headers: new Headers({ "Content-Type": "application/json" }),
text: async () => `${JSON.stringify(mockResponse)}\nextra`,
});