Skip to content

Configuration

Scriptorium.Nib.Snapshot behaviour is controlled by SnapshotConfig — a plain record with sensible defaults.

FieldTypeDefaultDescription
DirectoryNamestring"__snapshots__"Name of the directory that holds snapshot files, relative to the test file.
Extensionstring".snap"File extension for snapshot files (including the dot).
UpdateEnvironmentVariablestring"UPDATE_SNAPSHOTS"Environment variable that triggers snapshot updates when set.
AutoCreatebooltrueWhen true, missing snapshots are created automatically and the test passes. When false, missing snapshots cause the test to fail.

Use record update syntax to override only the fields you need:

let ciConfig =
{ SnapshotConfig.Default with
AutoCreate = false
}
assertThat myValue (Snapshot.matches ("my snapshot", config = ciConfig))