increase timeout, better log
This commit is contained in:
parent
889d7f91a1
commit
2111874e6c
2 changed files with 10 additions and 6 deletions
|
|
@ -26,7 +26,7 @@ export class DefaultCrawler {
|
|||
});
|
||||
if (!resp.ok) {
|
||||
const text = await resp.text();
|
||||
throw new Error(`Failed to crawl site: ${text}`);
|
||||
throw new Error(`Failed to crawl site (${resp.status}): ${text}`);
|
||||
}
|
||||
const json = (await resp.json()) as PageData[];
|
||||
return json;
|
||||
|
|
|
|||
|
|
@ -152,11 +152,15 @@ describe("DocsCrawler", () => {
|
|||
);
|
||||
|
||||
commonDocsSites.forEach((url) => {
|
||||
test(`Default crawler common site: ${url}`, async () => {
|
||||
const { pages, crawler } = await runCrawl(url);
|
||||
expect(pages.length).toBeGreaterThanOrEqual(1);
|
||||
expect(crawler).toEqual("default");
|
||||
});
|
||||
test(
|
||||
`Default crawler common site: ${url}`,
|
||||
async () => {
|
||||
const { pages, crawler } = await runCrawl(url);
|
||||
expect(pages.length).toBeGreaterThanOrEqual(1);
|
||||
expect(crawler).toEqual("default");
|
||||
},
|
||||
TIMEOUT_MS,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue