mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:18:28 +00:00
test: add fetch mock helper and reaction coverage
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user