test: add fetch mock helper and reaction coverage

This commit is contained in:
Sebastian
2026-02-17 09:01:30 -05:00
parent 0e023e300e
commit cc359d338e
28 changed files with 193 additions and 106 deletions

View File

@@ -43,7 +43,8 @@ describe("memory indexing with OpenAI batches", () => {
async function readOpenAIBatchUploadRequests(body: FormData) {
let uploadedRequests: Array<{ custom_id?: string }> = [];
for (const [key, value] of body.entries()) {
const entries = body.entries() as IterableIterator<[string, FormDataEntryValue]>;
for (const [key, value] of entries) {
if (key !== "file") {
continue;
}
@@ -51,7 +52,7 @@ describe("memory indexing with OpenAI batches", () => {
uploadedRequests = text
.split("\n")
.filter(Boolean)
.map((line) => JSON.parse(line) as { custom_id?: string });
.map((line: string) => JSON.parse(line) as { custom_id?: string });
}
return uploadedRequests;
}