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.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Remove chai.use from tests
Ondra Urban866cfc5637b7
diff --git a/test/.eslintrc.json b/test/.eslintrc.jsonindex b01f85a25..311ecf443 100644--- a/test/.eslintrc.json+++ b/test/.eslintrc.json@@ -9,6 +9,7 @@"afterAll": false,"beforeEach": false,"afterEach": false,- "expect": false+ "expect": false,+ "test": false}}diff --git a/test/_helper.js b/test/_helper.jsindex d845f112e..3651f06e9 100644--- a/test/_helper.js+++ b/test/_helper.js@@ -1,12 +1,7 @@import fs from 'fs-extra';import path from 'path';-import chaiSubset from 'chai-subset';-import chaiAsPromised from 'chai-as-promised';import { ENV_VARS } from 'apify-shared/consts';-chai.use(chaiSubset);-chai.use(chaiAsPromised);-export const LOCAL_STORAGE_DIR = path.join(__dirname, '..', 'tmp', 'local-emulation-dir');// Log unhandled rejections.diff --git a/test/actor.test.js b/test/actor.test.jsindex 8dcc4d5d7..e367c2821 100644--- a/test/actor.test.js+++ b/test/actor.test.js@@ -1,6 +1,5 @@import path from 'path';import _ from 'underscore';-import chaiSubset from 'chai-subset';import sinon from 'sinon';import { delayPromise } from 'apify-shared/utilities';import { ENV_VARS, ACT_JOB_STATUSES, LOCAL_ENV_VARS } from 'apify-shared/consts';@@ -9,8 +8,6 @@ import { ApifyCallError } from '../build/errors';// NOTE: test use of require() here because this is how its done in actsconst Apify = require('../build/index');-chai.use(chaiSubset);-const { utils: { log } } = Apify;// TODO: override console.log() to test the error messages (now they are printed to console)diff --git a/test/autoscaling/autoscaled_pool.test.js b/test/autoscaling/autoscaled_pool.test.jsindex 48f8d515b..691395516 100644--- a/test/autoscaling/autoscaled_pool.test.js+++ b/test/autoscaling/autoscaled_pool.test.js@@ -1,4 +1,3 @@-import chaiAsPromised from 'chai-as-promised';import _ from 'underscore';import { delayPromise } from 'apify-shared/utilities';import log from 'apify-shared/log';@@ -6,8 +5,6 @@ import AutoscaledPool from '../../build/autoscaling/autoscaled_pool';/* eslint-disable no-underscore-dangle */-chai.use(chaiAsPromised);-describe('AutoscaledPool', () => {let logLevel;beforeAll(() => {diff --git a/test/puppeteer.test.js b/test/puppeteer.test.jsindex 8fbfe636f..e5a29c2f3 100644--- a/test/puppeteer.test.js+++ b/test/puppeteer.test.js@@ -1,4 +1,3 @@-import chaiAsPromised from 'chai-as-promised';import proxy from 'proxy';import http from 'http';import util from 'util';@@ -11,8 +10,6 @@ import Apify from '../build/index';import * as actor from '../build/actor';import * as utils from '../build/utils';-chai.use(chaiAsPromised);-let prevEnvHeadless;let proxyServer;let proxyPort; // eslint-disable-line no-unused-varsdiff --git a/test/utils_social.test.js b/test/utils_social.test.jsindex d1729a723..c3c71b116 100644--- a/test/utils_social.test.js+++ b/test/utils_social.test.js@@ -1,10 +1,7 @@import _ from 'underscore';-import chaiAsPromised from 'chai-as-promised';// import * as utils from '../build/utils';import Apify from '../build/index';-chai.use(chaiAsPromised);-const { social } = Apify.utils;describe('utils.social', () => {