feat(test): integration test for ts-sdk#4395
Conversation
|
Hey @kartik-mem0, can you also please add a cleanup step before and after the tests run? Would also want to wait for 5-10 seconds after the before step as clean up step is Async. Full project wipe — all four filters must be explicitly set to "*"client.delete_all(user_id="", agent_id="", app_id="", run_id="") |
hey @whysosaket fixed all integration tests now call the SDK's public methods directly zero _fetchWithErrorHandling or (client as any) usage anywhere. Added global cleanup before/after test runs with deleteAll({user_id:"", agent_id:"", app_id:"", run_id:""}) + 10s async wait. |
Description
Adds real integration tests for the MemoryClient platform SDK that hit the live Mem0 API — no mocks, no interceptors. Only a MEM0_API_KEY is needed to run; org/project are auto-resolved via
ping().
Integration test structure:
mem0-ts/src/client/tests/integration/
├── helpers.ts — env gating, client factory, polling helpers
├── initialization.test.ts — ping, error handling (5 tests)
├── crud.test.ts — add, get, getAll, update, delete (10 tests)
├── search.test.ts — search v1, v2, history (3 tests)
├── batch.test.ts — batch update, batch delete (2 tests)
├── management.test.ts — users, project, webhooks (6 tests)
└── feedback-and-export.test.ts — feedback, export (3 tests)
29 tests covering the full API surface:
Type of change
How Has This Been Tested?
Run integration tests (real API):
cd mem0-ts
MEM0_API_KEY=your-key npx jest src/client/tests/integration/ --verbose --forceExit
Run unit tests (no API key needed):
cd mem0-ts
pnpm run test:ci
Checklist: