API reference › @evolu/common › Test › testCreateDeps
function testCreateDeps(options?: { seed?: string }): TestDeps;
Defined in: packages/common/src/Test.ts:77
Creates deterministic TestDeps.
Each call creates fresh instances, so tests don't share state.
Includes these deps:
console: TestConsolerandom: RandomrandomLib: seededrandompackage instancerandomBytes: RandomBytestime: TestTime
Use this for synchronous code that accepts deps directly. For tests that run Tasks, use testCreateRun.
Example
test("Callbacks with no argument", () => {
const deps = testCreateDeps();
const callbacks = createCallbacks(deps);
let called = false;
const id = callbacks.register(() => {
called = true;
});
callbacks.execute(id);
expect(called).toBe(true);
});