From a3d1a1068b8e167f73e141865f48624a616aa1f2 Mon Sep 17 00:00:00 2001 From: kartik-mem0 Date: Thu, 13 Aug 2026 16:30:09 +0530 Subject: [PATCH] chore(ts-tests): delete dead global-setup/global-teardown files 227c02da9 dropped these from jest.integration.config.js and removed the fullProjectCleanup helper they called, since every integration suite already cleans up its own UUID-scoped user in afterAll. The two files themselves were left behind unreferenced. --- .../client/tests/integration/global-setup.ts | 40 ------------------- .../tests/integration/global-teardown.ts | 36 ----------------- 2 files changed, 76 deletions(-) delete mode 100644 mem0-ts/src/client/tests/integration/global-setup.ts delete mode 100644 mem0-ts/src/client/tests/integration/global-teardown.ts diff --git a/mem0-ts/src/client/tests/integration/global-setup.ts b/mem0-ts/src/client/tests/integration/global-setup.ts deleted file mode 100644 index 7adae5831..000000000 --- a/mem0-ts/src/client/tests/integration/global-setup.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Jest global setup for integration tests. - * - * Runs a full project cleanup before any integration test starts, - * then waits 10 seconds for the async cleanup to propagate. - */ -import { MemoryClient } from "../../mem0"; - -export default async function globalSetup() { - const apiKey = process.env.MEM0_API_KEY; - if (!apiKey) return; // skip if no key — tests will be skipped too - - const client = new MemoryClient({ apiKey }); - await client.ping(); - - console.log("[integration] Running pre-test cleanup..."); - - // Full project wipe — all four filters set explicitly - try { - await client.deleteAll({ - userId: "*", - agentId: "*", - appId: "*", - runId: "*", - }); - } catch { - // ignore — may 404 if no data exists - } - - try { - await client.deleteUsers(); - } catch { - // ignore — may throw "No entities to delete" - } - - // Wait 10 seconds for async cleanup to propagate - console.log("[integration] Waiting 10s for cleanup to propagate..."); - await new Promise((r) => setTimeout(r, 10_000)); - console.log("[integration] Pre-test cleanup done."); -} diff --git a/mem0-ts/src/client/tests/integration/global-teardown.ts b/mem0-ts/src/client/tests/integration/global-teardown.ts deleted file mode 100644 index 56815d556..000000000 --- a/mem0-ts/src/client/tests/integration/global-teardown.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Jest global teardown for integration tests. - * - * Runs a full project cleanup after all integration tests complete - * so no test data is left behind. - */ -import { MemoryClient } from "../../mem0"; - -export default async function globalTeardown() { - const apiKey = process.env.MEM0_API_KEY; - if (!apiKey) return; - - const client = new MemoryClient({ apiKey }); - await client.ping(); - - console.log("[integration] Running post-test cleanup..."); - - try { - await client.deleteAll({ - userId: "*", - agentId: "*", - appId: "*", - runId: "*", - }); - } catch { - // ignore - } - - try { - await client.deleteUsers(); - } catch { - // ignore - } - - console.log("[integration] Post-test cleanup done."); -}