Closed crizzis closed 3 years ago
Nice catch. Will look into resolving this. Otherwise if you do have a solution ready, send a PR and I'd gladly review and merge.
Cheers Marc
Closing this issue now as I've added error handling in v1.1.5. Let me know if you find anything else. Thanks heaps
When using a partial config for
byImage
mode, i.e.:new ComparePdf({ paths: { baselinePdfRootFolder: SNAPSHOTS_DIR, /* no values for actualPdfRootFolder, baselinePngRootFolder, actualPngRootFolder */ }, settings: ...)
,The comparison passes even if the actual PDFs are different. This is because
baselinePgnRootFolder
andactualPngRootFolder
both resolve to the literal string'undefined'
, and so the tool ends up overwriting and comparing a PNG image with itself.Instead, the tool could throw an error when one of the paths is undefined.