diff --git a/apps/api/src/scraper/scrapeURL/index.ts b/apps/api/src/scraper/scrapeURL/index.ts index 27a8f579..bf155c3c 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, intern const _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.ts index ba5d5f69..042fe060 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";