Your schema. Its natural habitat.
Keep your native types, validation and codecs. Start with a supported generator, or bring a factory for the details only you know.
Find your adapterA little mimic. A lot of possibility.
Typed fixtures. Coherent scenarios. Failures you can replay.
Give your tests a little life. Build fixtures that fit your schemas, keep related data connected, and bring a failing case back on cue.
Published alpha · 0.1.0-alpha.2
Available on npm’s next channel.
import Type from 'typebox';
import { fluent } from '@mimlet/core';
import { fromTypeBox } from '@mimlet/typebox';
const User = Type.Object({
id: Type.String({ default: 'user-1' }),
role: Type.Union([
Type.Literal('reader'),
Type.Literal('admin'),
]),
});
const users = fluent(fromTypeBox(User), ['id', 'role']);
export const admin = users.withRole('admin').buildValidated();
{ id: 'user-1', role: 'admin' }validatedSmall fixtures. Bigger stories.
From one object to a whole test world, keep the pieces you care about under your control.
Keep your native types, validation and codecs. Start with a supported generator, or bring a factory for the details only you know.
Find your adapterA customer, their order, the right total. Describe the relationships once, then build a coherent scenario for the test in front of you.
Build a scenarioUse explicit seeds and compatible replay records to reproduce a run. Shrink the inputs and recompute the relationships as the case gets smaller.
Meet replay and shrinkingBring just what you need
The builder core has no runtime dependencies. Add generation, protocols, property testing, or a local playground when the job calls for them.
For coding agents, too
Give your coding agent a clear starting point: real APIs, working recipes, and the boundaries that matter.
Open the agent guideTyped builders and tested recipes make the intended operations explicit.
Save a compatible replay record and return to the failing case.
Read concise Markdown, choose an adapter, and know when to use a factory.