Path to the PDF file or a Buffer containing the PDF.
Path to the directory where the __snapshots__
folder will be created.
Unique name for the snapshot within the specified path.
Optional
options: CompareOptionsOptions for comparison, including tolerance, mask regions, and behavior regarding missing snapshots. See CompareOptions for more details.
A promise that resolves to true
if the PDF matches the snapshot or if the behavior
allows for missing snapshots. Resolves to false
if the PDF differs from the snapshot
or if failOnMissingSnapshot
is true
and no snapshot exists.
The function has the following side effects:
failOnMissingSnapshot
is false
(default), the PDF is converted to an image,
saved as a new snapshot, and the function returns true
.failOnMissingSnapshot
is true
, the function returns false
without creating a new snapshot.false
and creates two additional images
next to the snapshot: one with the suffix new
(the current view of the PDF as an image)
and one with the suffix diff
(showing the difference between the snapshot and the new
image).true
. If new
and diff
versions are present, they are deleted.
Compares a PDF to a persisted snapshot, with behavior for handling missing snapshots controlled by the
failOnMissingSnapshot
option.