Configuration
Scriptorium.Nib.Snapshot behaviour is controlled by SnapshotConfig — a plain record with sensible defaults.
Fields
Section titled “Fields”| Field | Type | Default | Description |
|---|---|---|---|
DirectoryName | string | "__snapshots__" | Name of the directory that holds snapshot files, relative to the test file. |
Extension | string | ".snap" | File extension for snapshot files (including the dot). |
UpdateEnvironmentVariable | string | "UPDATE_SNAPSHOTS" | Environment variable that triggers snapshot updates when set. |
AutoCreate | bool | true | When true, missing snapshots are created automatically and the test passes. When false, missing snapshots cause the test to fail. |
Overriding defaults
Section titled “Overriding defaults”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))