JIXU DOCUMENTATION
jixu-testkit
Deterministic fixtures and the shared EventStore contract suite.
jixu-testkit provides deterministic infrastructure for testing Harness behavior and a reusable contract suite for custom Stores. Keep it in development dependencies.
Install
npm install --save-dev jixu-core jixu-testkitDeterministic fixtures
import {
FixedClock,
RecordingSignalSink,
SequenceIdGenerator,
SequenceModelDriver,
succeed,
} from "jixu-testkit";
const clock = new FixedClock("2026-01-01T00:00:00.000Z");
const ids = new SequenceIdGenerator();
const signals = new RecordingSignalSink();
const modelDriver = new SequenceModelDriver([
succeed({
content: "Deterministic result",
toolCalls: [],
}),
]);| Export | Purpose |
|---|---|
FixedClock | Return one stable timestamp |
SequenceClock | Return a declared sequence of timestamps |
SequenceIdGenerator | Generate predictable Thread and Event IDs |
SequenceModelDriver | Return declared model outcomes and record Effects |
RecordingSignalSink | Capture transient Signals for assertions |
succeed, fail, indeterminate | Construct typed Driver outcomes |
Verify a custom Store
The jixu-testkit/store-contract subpath runs the same load-bearing contract against any EventStore implementation:
import { defineStoreContract } from "jixu-testkit/store-contract";
import { MyEventStore } from "./my-event-store.js";
defineStoreContract("MyEventStore", async () => {
const store = new MyEventStore();
return {
store,
cleanup: () => store.close(),
};
});The contract covers immutable append behavior, revision conflicts, atomic Fork creation, Checkpoint validation, Artifact integrity, global Event ID uniqueness, and deterministic recovery semantics.
A contract is necessary, not sufficient
Passing the shared suite proves the public Store semantics exercised by Jixu. Add adapter-specific tests for cancellation, crash recovery, concurrency, deployment constraints, and any external service guarantees your implementation adds.