Skip to content
PackagesTooling and testingDocs 1.3.x

@connectum/testing ​

Supported service-test helpers, local clients, parity scenarios, in-memory telemetry collectors, and assertions.

Install ​

bash
npm install -D @connectum/testing
bash
pnpm add -D @connectum/testing
bash
bun add -d @connectum/testing

Peer 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 pointUse it to
createTestServerCreate an isolated Connectum server for a test.
withTestServerManage test-server setup and teardown.
createLocalClientExercise handlers through the in-process transport.

Learn / Configure / API Reference ​

Compare all Connectum packages by capability.