Testing
Choose the boundary that can disprove the behavior you are testing: an isolated decision, the assembled application, or the deployed service. Keep most business cases in fast TypeScript tests and reserve deployed scenarios for protocol and configuration boundaries.
For a server with the example Inventory implementation registered:
import assert from 'node:assert/strict';
import { createLocalClient } from '@connectum/testing';
const client = createLocalClient(server, InventoryService);
const stock = await client.checkStock({ sku: 'A-1' });
assert.equal(stock.units, 7);Choose a layer
Start with unit tests and fixtures, exercise application wiring in integration tests, then verify the running service with end-to-end tests.
Match a specific test task to a tool
| Question | Recommended surface |
|---|---|
| Does a handler or interceptor make the right decision? | Unit tests with @connectum/test-fixtures |
| Are routes, middleware and catalog dependencies wired correctly? | Integration tests with @connectum/testing |
| Do service-catalog calls resolve without a network listener? | In-process transport |
| Does a running service expose correct gRPC, Connect, health, auth, TLS, or streaming behavior? | runn |
| Do you need Go plugins or JUnit-oriented scenario output? | scenarigo |
Recommended path
- Test handler and middleware decisions in process.
- Start the real service with its generated proto contract.
- Exercise one successful call and the important failure paths through
runn. - Add deployment-specific probe or TLS scenarios only where that boundary matters.
Scenario tests catch serialization, validation, interceptor-order, reflection, and health-endpoint integration that isolated unit tests cannot. They should not repeat every business-rule case already covered in TypeScript.
Exact helper options live in the @connectum/testing API and @connectum/test-fixtures API.