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.

test: try to improve error handling around TS compilation

Martin Adámekd351b05c66fd
diff --git a/test/e2e/tools.mjs b/test/e2e/tools.mjs
index 68ba9c060..2735754e5 100644
--- a/test/e2e/tools.mjs
+++ b/test/e2e/tools.mjs
@@ -109,7 +109,15 @@ export async function runActor(dirName, memory = 4096) {
}
} else {
if (dirName.split('/').at(-2).endsWith('-ts')) {
- execSync('tsc', { cwd: dirName });
+ try {
+ execSync('tsc', { cwd: dirName });
+ } catch (/** @type {any} */ e) {
+ if ('stdout' in e) {
+ console.error(e.stdout.toString());
+ } else {
+ console.log(e);
+ }
+ }
}
await import(join(dirName, 'main.js'));