Testing with Qelos
@qelos/testing is the testing suite for apps that use the Qelos SDK or a Qelos integrator. Its core is a stateful, in-memory mimic of the Qelos HTTP API (sign up / sign in, sessions, workspaces, blueprint entities, ...), so your app, your tests and your CI can run without a Qelos tenant, a network or an account.
bash
npm i -D @qelos/testingWhat you can do with it
| Goal | Use | Guide |
|---|---|---|
| Unit-test code that uses the SDK | createMockSdk() from @qelos/testing/sdk | Unit testing |
| Test your HTTP app (Express, Fastify, Nest, ...) end to end | testApp() from @qelos/testing/http | Testing an app |
| Build seed data with factories | persona(), admin(), blueprint(), entities() from @qelos/testing/fixtures | Fixtures |
| Test retries, error handling and expiry | mock.faults (latency, 5xx, dropped connections, rate limits, expired sessions) | Fault injection |
| Script AI agent replies and tool calls | mock.ai | Scripted AI agents |
| Test checkout, subscriptions and invoices | sdk.payments on the mock, mock.payments | Payments |
| Replay recorded tenant responses for endpoints the mock lacks | createRecorder() and createMockQelos({ cassette }) | Record and replay |
| Develop locally with no tenant | Mock mode in your integrator, or qelos mock serve | Develop locally without a tenant |
| Seed realistic data | Import qelos dump / qelos pull folders into mock state | qelos mock |
| Run integration / e2e tests against a real HTTP server | createMockQelos() + the qelos-testing bin | Package README |
| Test your integrator setup | Enable mock mode in Express, Next.js, Nuxt, Fastify, NestJS or FastAPI | Integrators |
Safety
Mock mode refuses to run in production (NODE_ENV=production, non-debug FastAPI runs, ...) unless you opt in explicitly. Install @qelos/testing as a dev dependency only.
