Skip to content

Commit a08617f

Browse files
amikofalvyclaude
andauthored
Fix pixelmatch type error breaking CI builds (#2199)
The `diffBuf` variable was typed as `Uint8Array | null`, but pixelmatch's third parameter expects `Uint8Array | undefined` (not null). Changed to use `undefined` for the pixelmatch call and `?? null` for the return value which expects `TypedArray | null`. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e623802 commit a08617f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agents-manage-ui/vitest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ export default defineConfig({
130130
? (actual.data as Uint8Array)
131131
: cropRgba(actual.data, aW, w, h);
132132

133-
const diffBuf = createDiff ? new Uint8Array(w * h * 4) : null;
133+
const diffBuf = createDiff ? new Uint8Array(w * h * 4) : undefined;
134134
const mismatched = pixelmatch(refData, actData, diffBuf, w, h, { threshold });
135135

136136
const total = w * h;
137137
const ratio = mismatched / total;
138138

139139
return {
140140
pass: ratio <= allowedMismatchedPixelRatio,
141-
diff: diffBuf,
141+
diff: diffBuf ?? null,
142142
message:
143143
ratio > allowedMismatchedPixelRatio
144144
? `${mismatched} pixels (${(ratio * 100).toFixed(2)}%) mismatched, allowed: ${(allowedMismatchedPixelRatio * 100).toFixed(2)}%`

0 commit comments

Comments
 (0)