Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

chore(test): use crawler.statistics in the maxRequestsPerCrawl budget tests

Martin Adámek4bca1e65f721
diff --git a/test/core/crawlers/basic_crawler.test.ts b/test/core/crawlers/basic_crawler.test.ts
index a40b2b1ce..26d70dc16 100644
--- a/test/core/crawlers/basic_crawler.test.ts
+++ b/test/core/crawlers/basic_crawler.test.ts
@@ -3066,7 +3066,7 @@ describe('BasicCrawler', () => {
return;
}
- crawler.stats.state.requestsFinished = 2;
+ crawler.statistics.state.requestsFinished = 2;
// e.g. `enqueueLinks({ urls, limit: config.limit })` where `config.limit` is not set
await context.addRequests(requestsToAdd, { limit: undefined, label: 'child' });
@@ -3105,7 +3105,7 @@ describe('BasicCrawler', () => {
return;
}
- crawler.stats.state.requestsFinished = 2;
+ crawler.statistics.state.requestsFinished = 2;
await context.addRequests(requestsToAdd, { limit: 4, label: 'child' });
},