mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Use pixelmatch for image comparison
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
"pathe",
|
||||
"pbrolin",
|
||||
"phpbb",
|
||||
"pixelmatch",
|
||||
"plantuml",
|
||||
"playfair",
|
||||
"pnpm",
|
||||
|
@@ -26,12 +26,16 @@
|
||||
|
||||
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
||||
|
||||
addMatchImageSnapshotCommand({
|
||||
comparisonMethod: 'ssim',
|
||||
failureThreshold: 0.01,
|
||||
failureThresholdType: 'percent',
|
||||
customDiffConfig: {
|
||||
ssim: 'fast',
|
||||
},
|
||||
blur: 1,
|
||||
});
|
||||
// The SSIM comparison method can be used if the pixelmatch is throwing lots of false positives.
|
||||
// SSIM actually does not catch minute changes in the image, so it is not as accurate as pixelmatch.
|
||||
// addMatchImageSnapshotCommand({
|
||||
// comparisonMethod: 'ssim',
|
||||
// failureThreshold: 0.01,
|
||||
// failureThresholdType: 'percent',
|
||||
// customDiffConfig: {
|
||||
// ssim: 'fast',
|
||||
// },
|
||||
// blur: 1,
|
||||
// });
|
||||
|
||||
addMatchImageSnapshotCommand();
|
||||
|
Reference in New Issue
Block a user