createUnitConvex

test-convex · /unit·function

Builds the convex-test harness for the fast, hermetic unit tier: a fully in-memory backend that never spawns a real deployment or touches the network. The convex-test counterpart to the per-file mongoose mocks the Mongo tier relied on.

The deployed schema is INJECTED rather than imported here: this package's source is built under a composite tsconfig with rootDir: src, so a runtime (value) import of the sibling convex package's schema.ts would fail tsc with TS6059 ("not under rootDir"). The schema's value import therefore lives in the calling *.test.ts (excluded from the composite build), exactly as the convex-test fixtures hand it to convexTest today, and the binding flows through this thin wrapper.

Signature

@nordcom/commerce-test-convex
function createUnitConvex(schema: SchemaDefinition<Schema, boolean>, extra: UnitModuleMap): UnitConvexHarness<Schema>;

Parameters

NameTypeDescription
schemaSchemaDefinition<Schema, boolean>
extraUnitModuleMap

Returns

A bound to schema.

UnitConvexHarness UnitModuleMap unitModuleMap

Sourceunit.ts:61Edit the JSDoc directly
Metadata@nordcom/commerce-test-convex@0.0.0Open in GitHub ↗

On this page