Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui-tests/cypress.config.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ module.exports = defineConfig({
const data = new Uint8Array(fs.readFileSync(filePath));
const pdfDoc = await pdfjsLib.getDocument({ data }).promise;

// Import pixelmatch only if logo check is needed
let pixelmatch;
// Import blazediff only if logo check is needed
let blazediff;
const doLogoCheck = !!options.referenceLogoPath;
if (doLogoCheck) {
const pm = await import("pixelmatch");
pixelmatch = pm.default;
const { diff } = await import("@blazediff/core");
blazediff = diff;
}

let hasImage = false;
Expand Down Expand Up @@ -88,7 +88,7 @@ module.exports = defineConfig({
const resizedPdfImg = PNG.sync.read(resizedPdfBuffer);

const diff = new PNG({ width: refLogo.width, height: refLogo.height });
const mismatched = pixelmatch(
const mismatched = blazediff(
refLogo.data,
resizedPdfImg.data,
diff.data,
Expand Down
24 changes: 10 additions & 14 deletions ui-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"moment": "^2.29.4"
},
"devDependencies": {
"@blazediff/core": "^1.9.0",
"cypress": "^13.4.0",
"pdfjs-dist": "^3.11.174",
"pixelmatch": "^7.1.0",
"pngjs": "^7.0.0",
"sharp": "^0.34.4"
}
Expand Down