Skip to content

Commit b1de0bb

Browse files
committed
reduce pixelmatch threshold to 0 for non-mapbox also fail on mapbox big diffs
1 parent 7a44a8e commit b1de0bb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/image/compare_pixels_test.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,18 @@ for(var i = 0; i < allMockList.length; i++) {
114114
height: height
115115
});
116116

117-
var numDiffPixels = pixelmatch(img0.data, img1.data, diff.data, width, height, {threshold: 0.1});
117+
var shouldBePixelPerfect = mockName.substr(0, 7) !== 'mapbox_' && [
118+
// list flaky mocks other than mapbox:
119+
'gl3d_bunny-hull'
120+
].indexOf(mockName) === -1;
121+
122+
var numDiffPixels = pixelmatch(img0.data, img1.data, diff.data, width, height, {
123+
threshold: shouldBePixelPerfect ? 0 : 0.2
124+
});
125+
118126
if(numDiffPixels) {
119127
fs.writeFileSync(imagePaths.diff, PNG.sync.write(diff));
120128

121-
// mapbox behave differently from run-to-run
122-
// skip error on mapbox diff
123-
if(mockName.substr(7) === 'mapbox_') continue;
124-
125129
console.error('pixels do not match: ' + numDiffPixels);
126130
fail(mockName);
127131
} else {

0 commit comments

Comments
 (0)