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: update jest to v27

Martin Adámek9be034f7e34e
diff --git a/package.json b/package.json
index caf6b5e03..b14d2c846 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,7 @@
"@types/content-type": "^1.1.5",
"@types/fs-extra": "^9.0.12",
"@types/htmlparser2": "^3.10.3",
- "@types/jest": "^26.0.24",
+ "@types/jest": "^27.0.1",
"@types/request-promise-native": "^1.0.18",
"@types/rimraf": "^3.0.1",
"@types/semver": "^7.3.7",
@@ -116,8 +116,8 @@
"eslint": "^7.31.0",
"fpcollect": "^1.0.4",
"fpscanner": "^0.1.5",
- "jest": "^26.6.3",
- "jest-circus": "^26.6.3",
+ "jest": "^27.1.1",
+ "jest-circus": "^27.1.1",
"playwright": "1.14.1",
"portastic": "^1.0.1",
"proxy": "^1.0.2",
@@ -126,7 +126,7 @@
"sinon": "^11.0.0",
"sinon-stub-promise": "^4.0.0",
"socket.io-client": "^3.0.3",
- "ts-jest": "^26.5.6",
+ "ts-jest": "^27.0.5",
"typescript": "4.4.2",
"ua-parser-js": "^0.7.28",
"why-is-node-running": "^2.2.0"
diff --git a/test/autoscaling/snapshotter.test.js b/test/autoscaling/snapshotter.test.js
index 70ee0ca9f..7acd81780 100644
--- a/test/autoscaling/snapshotter.test.js
+++ b/test/autoscaling/snapshotter.test.js
@@ -81,7 +81,6 @@ describe('Snapshotter', () => {
});
test('should override default timers', async () => {
- jest.useFakeTimers();
const options = {
eventLoopSnapshotIntervalSecs: 0.05,
memorySnapshotIntervalSecs: 0.1,
@@ -89,7 +88,7 @@ describe('Snapshotter', () => {
};
const snapshotter = new Snapshotter(options);
await snapshotter.start();
- jest.advanceTimersByTime(500);
+ await new Promise((resolve) => setTimeout(resolve, 500));
await snapshotter.stop();
// const memorySnapshots = snapshotter.getMemorySample();
const eventLoopSnapshots = snapshotter.getEventLoopSample();