@connectum/testing
Supported service-test helpers, local clients, parity scenarios, in-memory telemetry collectors, and assertions.
Install
bash
npm install -D @connectum/testingbash
pnpm add -D @connectum/testingbash
bun add -d @connectum/testingPeer dependencies: @bufbuild/protobuf ^2.16.0, @connectrpc/connect ^2.2.0 and @connectrpc/connect-node ^2.2.0, shared with your application. npm 7+, pnpm and Bun install missing peers automatically; on Yarn, add them yourself — see Peer dependencies on protobuf and Connect.
Start Here
Use the service and generated GreeterService descriptor from Quickstart.
typescript
import assert from 'node:assert/strict';
import { createClient } from '@connectrpc/connect';
import { withTestServer } from '@connectum/testing';
await withTestServer({ services: [greeterService] }, async (server) => {
const client = createClient(GreeterService, server.transport);
const response = await client.sayHello({ name: 'Ada' });
assert.equal(response.message, 'Hello, Ada!');
});Key Entry Points
| Entry point | Use it to |
|---|---|
createTestServer | Create an isolated Connectum server for a test. |
withTestServer | Manage test-server setup and teardown. |
createLocalClient | Exercise handlers through the in-process transport. |
Learn / Configure / API Reference
- Learn: Focused guide
- Configure: Task and configuration guidance
- API reference: Exact options and symbols
- Package API index: Generated TypeDoc
- Source: @connectum/testing on GitHub
Related Modules
Compare all Connectum packages by capability.