Added tests

This commit is contained in:
rafaelsideguide 2024-05-07 14:03:00 -03:00
parent f46bf19fa5
commit 61d615c04b
2 changed files with 10 additions and 3 deletions

View File

@ -280,7 +280,12 @@ describe("E2E Tests for API Routes", () => {
expect(completedResponse.statusCode).toBe(200);
expect(completedResponse.body).toHaveProperty("status");
expect(completedResponse.body.status).toBe("failed");
expect(completedResponse.body).toHaveProperty("data");
expect(completedResponse.body.data).toEqual(null);
expect(completedResponse.body).toHaveProperty("partial_data");
expect(completedResponse.body.partial_data[0]).toHaveProperty("content");
expect(completedResponse.body.partial_data[0]).toHaveProperty("markdown");
expect(completedResponse.body.partial_data[0]).toHaveProperty("metadata");
}, 60000); // 60 seconds

View File

@ -80,7 +80,9 @@ export class WebScraperDataProvider {
);
}
}
} catch (error) {}
} catch (error) {
console.error(error);
}
}
return results.filter((result) => result !== null) as Document[];
}