Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (minDelta >= threshold) {
tapeContext.fail(
`<img src="${image}"> vs <img src="${
baselines[0]
}"> === <img src="${minDiff}">`
);
}
if (nextCallback) {
nextCallback();
} else {
tapeContext.end();
}
}
resemble.outputSettings({
transparency: 0.5,
});
baselines.forEach((baseline, idx) => {
resemble(baseline)
.compareTo(image)
.ignoreAntialiasing()
.onComplete((data) => {
if (minDelta >= data.misMatchPercentage) {
minDelta = data.misMatchPercentage;
minDiff = data.getImageDataUrl();
}
isSameDimensions = isSameDimensions || data.isSameDimensions;
if (idx + 1 === nbBaselines) {
done();
}