test: add integration tests for CRUD, feedback, export and update CI workflow

This commit is contained in:
kartik-mem0
2026-03-19 15:48:35 +05:30
parent a14bc1ff24
commit 1b7c904b98
10 changed files with 287 additions and 230 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.");
}