Compare commits

...

1 Commits

2 changed files with 8 additions and 2 deletions
@@ -4,12 +4,15 @@
* 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 pkg = require("../../../../package.json");
(globalThis as any).__MEM0_SDK_VERSION__ = pkg.version;
const apiKey = process.env.MEM0_API_KEY;
if (!apiKey) return; // skip if no key — tests will be skipped too
const { MemoryClient } = await import("../../mem0");
const client = new MemoryClient({ apiKey });
await client.ping();
@@ -4,12 +4,15 @@
* 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 pkg = require("../../../../package.json");
(globalThis as any).__MEM0_SDK_VERSION__ = pkg.version;
const apiKey = process.env.MEM0_API_KEY;
if (!apiKey) return;
const { MemoryClient } = await import("../../mem0");
const client = new MemoryClient({ apiKey });
await client.ping();