Skip to content
GuidesTesting

Testing

How to run the unit tests against in-memory fakes and the live conformance suite against real backends.

The repository has two test suites. Unit tests run against in-memory fakes and need no backend. Live tests run the same conformance suite against real providers.

Run the unit tests

bun run test

Most adapters accept any client that satisfies a structural *ClientLike interface, which lists only the methods the adapter calls. The real SDK client satisfies it, and the unit tests pass fakes. The Vectorize adapter names the cloudflare client type, so its tests build a real Cloudflare client with a fake fetch and answer the v2 HTTP API in memory. The Redis fake reads the namespace out of the query it is given and answers with the documents it holds, so the tests can assert the query string the adapter writes.

Run the live tests

Set VECSTORE_LIVE=1 and the connection variables for the providers you have:

QDRANT_URL=http://localhost:6333 \
PGVECTOR_URL=postgres://postgres:postgres@localhost:5432/postgres \
PINECONE_API_KEY=your_pinecone_api_key \
SUPABASE_URL=https://your_project_ref_here.supabase.co \
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here \
UPSTASH_VECTOR_REST_URL=https://your-index.upstash.io \
UPSTASH_VECTOR_REST_TOKEN=your_upstash_token \
CLOUDFLARE_ACCOUNT_ID=your_account_id_here \
CLOUDFLARE_API_TOKEN=your_api_token_here \
REDIS_URL=redis://localhost:6379 \
bun run test:live

The suite skips providers without a variable. For each provider it creates a temporary index, exercises every verb and filter operator, and deletes the index.

Three providers ask for more. Supabase needs the SQL functions installed before the suite runs, and the service role key because the suite creates and drops tables. Upstash cannot create an index at all, so the adapter creates a namespace inside the index your URL and token point at. Point them at a scratch index with dimension 3 and the cosine similarity function, which is what the conformance suite asks for. The Vectorize token needs the Vectorize permission, and that run skips the delete({ all: true }) case, because Vectorize has no call that empties a namespace. REDIS_URL has to point at a server that carries the query engine and JSON, such as Redis 8 or Redis Stack; the Redis run adds cases for the default namespace, exists, list fields, and delete by filter.

On this page