Skip to content

Commit 42842b1

Browse files
committed
docs: update next example to not update images every time
1 parent 579a89c commit 42842b1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

examples/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"dev": "next dev",
55
"build": "next build",
66
"start": "next start",
7-
"cypress": "cypress open --env \"pluginVisualRegressionUpdateImages=true,pluginVisualRegressionImagesPath={spec_path}/__image_snapshots_local__\"",
7+
"cypress": "cypress open --env \"pluginVisualRegressionImagesPath={spec_path}/__image_snapshots_local__\"",
88
"cypress:ci": "cypress run --env \"pluginVisualRegressionUpdateImages=true\"",
99
"test:e2e": "start-server-and-test dev http://localhost:3000 \"pnpm cypress --e2e\"",
1010
"test:e2e:ci": "start-server-and-test dev http://localhost:3000 \"pnpm cypress:ci --e2e\"",

packages/cypress-plugin-visual-regression-diff/src/task.hook.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,15 @@ export const compareImagesTask = async (
103103
const diff = new PNG({ width, height });
104104
const diffConfig = Object.assign({ includeAA: true }, cfg.diffConfig);
105105

106+
const diffOutput = new Uint8Array(
107+
diff.data.buffer,
108+
diff.data.byteOffset,
109+
diff.data.byteLength,
110+
);
106111
const diffPixels = pixelmatch(
107112
new Uint8Array(imgNew.data),
108113
new Uint8Array(imgOld.data),
109-
new Uint8Array(diff.data),
114+
diffOutput,
110115
width,
111116
height,
112117
diffConfig,

0 commit comments

Comments
 (0)