diff --git a/README.md b/README.md index ee12bf3..868f893 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Jest matcher that performs image comparisons using [pixelmatch](https://github.c * `customDiffConfig`: Custom config passed [pixelmatch](https://github.com/mapbox/pixelmatch#pixelmatchimg1-img2-output-width-height-options) (See options section) * By default we have set the `threshold` to 0.01, you can increase that value by passing a customDiffConfig as demonstrated below. * Please note the `threshold` set in the `customDiffConfig` is the per pixel sensitivity threshold. For example with a source pixel colour of `#ffffff` (white) and a comparison pixel colour of `#fcfcfc` (really light grey) if you set the threshold to 0 then it would trigger a failure *on that pixel*. However if you were to use say 0.5 then it wouldn't, the colour difference would need to be much more extreme to trigger a failure on that pixel, say `#000000` (black) -* `customSnapshotsDir`: A custom directory to keep this snapshot in +* `customSnapshotsDir`: (default: `__image_snapshots__`) A custom directory to keep this snapshot in * `customSnapshotIdentifier`: A custom name to give this snapshot. If not provided one is computed automatically * `noColors`: (default `false`) Removes colouring from console output, useful if storing the results in a file * `failureThreshold`: (default `0`) Sets the threshold that would trigger a test failure based on the `failureThresholdType` selected. This is different to the `customDiffConfig.threshold` above, that is the per pixel failure threshold, this is the failure threshold for the entire comparison. @@ -82,7 +82,7 @@ expect.extend({ toMatchImageSnapshot }); ``` ## How it works - Given an image (should be either a PNGImage instance or a Buffer instance with PNG data) the `toMatchImageSnapshot()` matcher will create a `__image_snapshots__` directory in the directory the test is in and will store the baseline snapshot image there on the first run. + Given an image (should be either a PNGImage instance or a Buffer instance with PNG data) the `toMatchImageSnapshot()` matcher will create a `__image_snapshots__` directory in the directory the test is in and will store the baseline snapshot image there on the first run. Note that if `customSnapshotsDir` option is given then it will store baseline snapshot there instead. On subsequent test runs the matcher will compare the image being passed against the stored snapshot.