Skip to content

runValidationAdapterConformance

runValidationAdapterConformance(factory, options?): Promise<ConformanceReport>

Defined in: packages/core/src/conformance/validation-adapter.ts:41

Run the validation adapter conformance suite against a user-supplied adapter. Test-framework agnostic: designed to be embedded in a single test (vitest test(), bun test(), node:test, etc.). Throws ConformanceError with an aggregated report on any failure.

Each builder under basic, continuations, blockers, and external is typed with the precise phantom job type definitions the suite expects. The adapter under test must thread its schema-to-shape inference correctly to satisfy these return types — TypeScript rejects the factory value at the runner call site otherwise. This is what makes the suite a combined runtime AND type-level conformance check.

() => Promise<ValidationConformanceFixture>

ValidationConformanceOptions

Promise<ConformanceReport>

await runValidationAdapterConformance(async () => ({
basic: {
buildEntry: () => createMyJobTypes({
main: { entry: true, input: schema({ id: "string" }), output: schema({ ok: "boolean" }) },
}),
// ... other required builders
},
continuations: { buildNominal: () => ..., buildStructural: () => ... },
blockers: { buildNominal: () => ..., buildStructural: () => ... },
external: { buildWithExternalSlice: () => ..., buildWithExternalSlices: () => ... },
}));