Skip to content

Commit 1df89c5

Browse files
committed
add tolerance of 1e-6 to pixel comparison tests
1 parent f1bdea0 commit 1df89c5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Diff for: test/image/compare_pixels_test.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,25 @@ function testMock(fileName, t) {
9898
var options = {
9999
file: diffPath,
100100
highlightColor: 'purple',
101-
tolerance: 0.0
101+
tolerance: 1e-6
102102
};
103103

104+
/*
105+
* N.B. The non-zero tolerance was added in
106+
* https://github.com/plotly/plotly.js/pull/243
107+
* where some legend mocks started generating different png outputs
108+
* on `npm run test-image` and `npm run test-image -- mock.json`.
109+
*
110+
* Note that the svg outputs for the problematic mocks were the same
111+
* and playing around with the batch size and timeout durations
112+
* did not seem to affect the results.
113+
*
114+
* With the above tolerance individual `npm run test-image` and
115+
* `npm run test-image -- mock.json` give the same result.
116+
*
117+
* Further investigation is needed.
118+
*/
119+
104120
gm.compare(
105121
savedImagePath,
106122
path.join(constants.pathToTestImageBaselines, imageFileName),

0 commit comments

Comments
 (0)