local API · proof
Rehearse, then verify the receipt.
Use mock goldens for deterministic behavior and trace verification for the integrity of the recorded run journal.
Testing and trace verification answer different questions. A golden judges behavior; the chain judges whether recorded evidence stayed intact.
Run the offline golden.
The default test path compares against the stored expectation. It returns a verdict with the engine exit code and combined output.
const verdict = await nika.test('workflows/release.nika.yaml')
if (!verdict.passed) {
console.error(verdict.output)
process.exit(verdict.exitCode)
}Make expectation changes visible.
Updating a golden is a separate call because replacing evidence should never hide inside the ordinary test path.
await nika.test('workflows/release.nika.yaml', {
update: true,
})Verify the latest or a named trace.
The bare verifier uses the workspace latest on current engines. Pass a path when the application already owns the exact receipt identity.
const trace = await nika.traceVerify(
'.nika/traces/release.ndjson',
)
if (!trace.intact) throw new Error(trace.output)
console.info('chain head', trace.head)