feat(test): integration test for ts-sdk (#4395)

This commit is contained in:
Kartik
2026-03-19 18:11:09 +05:30
committed by GitHub
parent 410b79c750
commit 22c2545d61
11 changed files with 942 additions and 2 deletions
@@ -0,0 +1,36 @@
/**
* 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({
user_id: "*",
agent_id: "*",
app_id: "*",
run_id: "*",
});
} catch {
// ignore
}
try {
await client.deleteUsers();
} catch {
// ignore
}
console.log("[integration] Post-test cleanup done.");
}