Skip to content

Configuration

Configuration options can be passed when defining the file matchers:

ts
import { defineFileSnapshotMatchers } from "@cronn/playwright-file-snapshots";

const expect = defineFileSnapshotMatchers({
  validationDir: "custom-validation",
  outputDir: "custom-output",
});
OptionDefault ValueDescription
validationDirdata/test/validationDirectory in which golden masters are stored.
outputDirdata/test/outputDirectory in which file snapshots from test runs are stored.
indentSize2Indentation size in spaces used for serializing snapshots.
resolveFileNameresolveNameAsFileCustom resolver for the file path used to store snapshots.
updateDelay250Delay in ms before repeatable snapshots are created in update mode.