Skip to content

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

Merged
whysosaket merged 13 commits intomainfrom
feat/integration-test
Mar 19, 2026
Merged

feat(test): integration test for ts-sdk#4395
whysosaket merged 13 commits intomainfrom
feat/integration-test

Conversation

@kartik-mem0
Copy link
Copy Markdown
Contributor

@kartik-mem0 kartik-mem0 commented Mar 18, 2026

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:

  • Gated by MEM0_API_KEY env var — auto-skips when not set (safe for forks/OSS CI)
  • Each test file uses unique UUID-based user IDs for isolation
  • Cleanup runs in afterAll regardless of pass/fail
  • Handles async memory processing via polling helper

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit Test

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

  • All 29 integration tests pass against the live Mem0 API
  • All 470 existing unit tests pass with no regressions
  • Integration tests correctly skip when MEM0_API_KEY is not set

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

@kartik-mem0 kartik-mem0 marked this pull request as ready for review March 18, 2026 07:58
@kartik-mem0 kartik-mem0 changed the title Feat/integration test feat(test): integration test for ts-sdk Mar 18, 2026
@kartik-mem0 kartik-mem0 requested a review from whysosaket March 18, 2026 08:04
@whysosaket
Copy link
Copy Markdown
Member

whysosaket commented Mar 19, 2026

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="")

@kartik-mem0
Copy link
Copy Markdown
Contributor Author

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.

@whysosaket whysosaket merged commit 22c2545 into main Mar 19, 2026
8 checks passed
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants