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
Nick: prod and local-no-auth tests
Nicolas52620bab16e0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex b9a5b7949..69a8a243a 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -54,5 +54,5 @@ jobs:id: start_workers- name: Run E2E testsrun: |- npx jest --detectOpenHandles --forceExit --openHandlesTimeout=120000 --watchAll=false+ npm run test:prodworking-directory: ./apps/api\ No newline at end of filediff --git a/apps/api/package.json b/apps/api/package.jsonindex cbce4bed8..0b533f99d 100644--- a/apps/api/package.json+++ b/apps/api/package.json@@ -11,6 +11,8 @@"start:dev": "nodemon --exec ts-node src/index.ts","build": "tsc","test": "jest --verbose",+ "test:local-no-auth":"npx jest --detectOpenHandles --forceExit --openHandlesTimeout=120000 --watchAll=false --testPathIgnorePatterns='src/__tests__/e2e_withAuth/*'",+ "test:prod":"npx jest --detectOpenHandles --forceExit --openHandlesTimeout=120000 --watchAll=false --testPathIgnorePatterns='src/__tests__/e2e_noAuth/*'","workers": "nodemon --exec ts-node src/services/queue-worker.ts","worker:production": "node dist/src/services/queue-worker.js","mongo-docker": "docker run -d -p 2717:27017 -v ./mongo-data:/data/db --name mongodb mongo:latest",diff --git a/apps/api/src/__tests__/e2e/index.test.ts b/apps/api/src/__tests__/e2e_withAuth/index.test.tssimilarity index 100%rename from apps/api/src/__tests__/e2e/index.test.tsrename to apps/api/src/__tests__/e2e_withAuth/index.test.tsdiff --git a/apps/api/src/lib/withAuth.ts b/apps/api/src/lib/withAuth.tsindex 3ed8906b7..ea5aa4d80 100644--- a/apps/api/src/lib/withAuth.ts+++ b/apps/api/src/lib/withAuth.ts@@ -1,11 +1,16 @@import { AuthResponse } from "../../src/types";+let warningCount = 0;+export function withAuth<T extends AuthResponse, U extends any[]>(originalFunction: (...args: U) => Promise<T>) {return async function (...args: U): Promise<T> {if (process.env.USE_DB_AUTHENTICATION === "false") {- console.warn("WARNING - You're bypassing authentication");+ if (warningCount < 5) {+ console.warn("WARNING - You're bypassing authentication");+ warningCount++;+ }return { success: true } as T;} else {try {