JIXUDOCS
Packages

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-testkit

Deterministic 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: [],
  }),
]);
ExportPurpose
FixedClockReturn one stable timestamp
SequenceClockReturn a declared sequence of timestamps
SequenceIdGeneratorGenerate predictable Thread and Event IDs
SequenceModelDriverReturn declared model outcomes and record Effects
RecordingSignalSinkCapture transient Signals for assertions
succeed, fail, indeterminateConstruct 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.