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: make `format:check` actually check the formatting (#3858)

Martin Adámek8f95bb24f159
diff --git a/package.json b/package.json
index f5a6e8e68..7f2f36ace 100644
--- a/package.json
+++ b/package.json
@@ -53,7 +53,7 @@
"lint": "oxlint packages test docs --tsconfig=tsconfig.json --type-aware",
"lint:fix": "oxlint packages test docs --tsconfig=tsconfig.json --type-aware --fix",
"format": "oxfmt packages test docs --write",
- "format:check": "oxfmt packages test docs",
+ "format:check": "oxfmt packages test docs --check",
"prepare": "husky"
},
"devDependencies": {
diff --git a/packages/browser-pool/test/remote-browser.test.ts b/packages/browser-pool/test/remote-browser.test.ts
index d4d24a4fa..cadacf7e9 100644
--- a/packages/browser-pool/test/remote-browser.test.ts
+++ b/packages/browser-pool/test/remote-browser.test.ts
@@ -83,7 +83,10 @@ function createMockLogger(): CrawleeLogger & { warning: ReturnType<typeof vi.fn>
}
/** A fake {@link RemoteConnection} that resolves to a fixed URL and records release() calls. */
-function createConnection(url = 'wss://remote:9222', context?: Record<string, unknown>): RemoteConnection & {
+function createConnection(
+ url = 'wss://remote:9222',
+ context?: Record<string, unknown>,
+): RemoteConnection & {
resolve: ReturnType<typeof vi.fn>;
release: ReturnType<typeof vi.fn>;
} {
@@ -147,7 +150,9 @@ describe('Remote connection — PlaywrightPlugin', () => {
const connection = createConnection();
plugin.useRemoteConnection(connection);
- await expect(plugin.launch(plugin.createLaunchContext())).rejects.toThrow(/Failed to connect to remote browser/);
+ await expect(plugin.launch(plugin.createLaunchContext())).rejects.toThrow(
+ /Failed to connect to remote browser/,
+ );
expect(connection.release).toHaveBeenCalledWith(42);
});
@@ -158,7 +163,9 @@ describe('Remote connection — PlaywrightPlugin', () => {
connection.resolve.mockRejectedValueOnce(new Error('no session'));
plugin.useRemoteConnection(connection);
- await expect(plugin.launch(plugin.createLaunchContext())).rejects.toThrow(/resolve the remote browser endpoint/);
+ await expect(plugin.launch(plugin.createLaunchContext())).rejects.toThrow(
+ /resolve the remote browser endpoint/,
+ );
expect(lib.connectOverCDP).not.toHaveBeenCalled();
expect(connection.release).not.toHaveBeenCalled();
});
@@ -198,7 +205,9 @@ describe('Remote connection — PuppeteerPlugin', () => {
const connection = createConnection();
plugin.useRemoteConnection(connection);
- await expect(plugin.launch(plugin.createLaunchContext())).rejects.toThrow(/Failed to connect to remote browser/);
+ await expect(plugin.launch(plugin.createLaunchContext())).rejects.toThrow(
+ /Failed to connect to remote browser/,
+ );
expect(connection.release).toHaveBeenCalledWith(42);
});
diff --git a/test/core/browser_launchers/playwright_launcher.test.ts b/test/core/browser_launchers/playwright_launcher.test.ts
index ba29d0408..e2008b345 100644
--- a/test/core/browser_launchers/playwright_launcher.test.ts
+++ b/test/core/browser_launchers/playwright_launcher.test.ts
@@ -288,5 +288,4 @@ describe('launchPlaywright()', () => {
recursive: true,
});
});
-
});
diff --git a/test/core/browser_launchers/puppeteer_launcher.test.ts b/test/core/browser_launchers/puppeteer_launcher.test.ts
index 9549c50d6..87f401b33 100644
--- a/test/core/browser_launchers/puppeteer_launcher.test.ts
+++ b/test/core/browser_launchers/puppeteer_launcher.test.ts
@@ -309,5 +309,4 @@ describe('launchPuppeteer()', () => {
recursive: true,
});
});
-
});