Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(scrapeURL): only retain ArrayTransport in testing
Gergő Móricz628a98d59459
diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.tsindex 27a8f579d..bf155c3c7 100644--- a/apps/api/src/scraper/scrapeURL/index.ts+++ b/apps/api/src/scraper/scrapeURL/index.ts@@ -97,7 +97,9 @@ function buildMetaObject(id: string, url: string, options: ScrapeOptions, internconst _logger = logger.child({ module: "ScrapeURL", scrapeId: id });const logs: any[] = [];- _logger.add(new ArrayTransport({ array: logs, scrapeId: id }));+ if (process.env.ENV !== "test") {+ _logger.add(new ArrayTransport({ array: logs, scrapeId: id }));+ }return {id, url, options, internalOptions,diff --git a/apps/api/src/scraper/scrapeURL/scrapeURL.test.ts b/apps/api/src/scraper/scrapeURL/scrapeURL.test.tsindex ba5d5f69a..042fe060c 100644--- a/apps/api/src/scraper/scrapeURL/scrapeURL.test.ts+++ b/apps/api/src/scraper/scrapeURL/scrapeURL.test.ts@@ -1,5 +1,7 @@import "dotenv/config";+process.env.ENV = "test";+import { scrapeURL } from ".";import { scrapeOptions } from "../../controllers/v1/types";import { Engine } from "./engines";