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.

Remove random element from tests

Ondra Urbanb30828cc408b
diff --git a/test/utils.js b/test/utils.js
index 9f32116d2..821142754 100644
--- a/test/utils.js
+++ b/test/utils.js
@@ -371,8 +371,8 @@ describe('Apify.utils.extractUrls()', () => {
const text = fs.readFileSync(path.join(__dirname, 'data', 'lipsum.txt'), 'utf8').split('');
const ID = 'ů';
const maxIndex = text.length - 1;
- array.forEach(() => {
- const indexInText = Math.round(Math.random() * maxIndex);
+ array.forEach((_, index) => {
+ const indexInText = (index * 17) % maxIndex;
if (text[indexInText] === ID) {
text[indexInText + 1] = ID;
} else {