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
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ fetch-blob under the MIT license.
node-domexception under the MIT license.
web-streams-polyfill under the MIT license.
formdata-polyfill under the MIT license.
pixelmatch under the ISC license.
blazediff under the MIT license.
vite-plugin-eslint2 under the MIT license.
@types/eslint under the MIT license.
@types/json-schema under the MIT license.
Expand Down
31 changes: 17 additions & 14 deletions source/frontend/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 source/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.8.7",
"@babel/preset-react": "^7.8.3",
"@blazediff/core": "^1.0.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
Expand All @@ -30,7 +31,6 @@
"jsdom": "^22.1.0",
"msw": "^2.4.9",
"node-fetch": "^3.3.1",
"pixelmatch": "^7.1.0",
"playwright": "^1.51.1",
"pngjs": "^7.0.0",
"prettier": "^3.0.0",
Expand Down
8 changes: 4 additions & 4 deletions source/frontend/src/tests/vitest/commands/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import {promises as fs} from 'node:fs';
import path from 'node:path';
import pixelmatch from 'pixelmatch';
import blazediff from '@blazediff/core';
import {PNG} from 'pngjs';

/**
Expand All @@ -30,7 +30,7 @@ export const compareScreenshot = async (context, screenshotPath, options) => {
testName,
baselineDir = `${testDir}/__image_snapshots__`,
diffDir = `${testDir}/__image_diffs__`,
threshold = 0.1, // recommended default in pixelmatch docs
threshold = 0.1, // recommended default in blazediff docs
maxDiffPercentage = 1.0,
updateBaseline = process.env.UPDATE_SNAPSHOTS === 'true',
} = options;
Expand Down Expand Up @@ -73,12 +73,12 @@ export const compareScreenshot = async (context, screenshotPath, options) => {
};
}

// Create empty diff image buffer (pixelmatch will mutate this buffer to store the diff)
// Create empty diff image buffer (blazediff will mutate this buffer to store the diff)
const {width, height} = img1;
const diff = new PNG({width, height});

// Compare images
const numDiffPixels = pixelmatch(
const numDiffPixels = blazediff(
img1.data,
img2.data,
diff.data,
Expand Down