Skip to content

Commit 32f46c5

Browse files
committed
add tolerance for jpeg image length test
1 parent b3fac37 commit 32f46c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/jasmine/tests/toimage_test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,22 @@ describe('Plotly.toImage', function() {
160160
.then(function() { return Plotly.toImage(gd, {format: 'png', imageDataOnly: true}); })
161161
.then(function(d) {
162162
expect(d.indexOf('data:image/')).toBe(-1);
163-
expect(d.length).toBeWithin(53660, 1e3);
163+
expect(d.length).toBeWithin(53660, 1e3, 'png image length');
164164
})
165165
.then(function() { return Plotly.toImage(gd, {format: 'jpeg', imageDataOnly: true}); })
166166
.then(function(d) {
167167
expect(d.indexOf('data:image/')).toBe(-1);
168-
expect(d.length).toBeWithin(43251, 1e3);
168+
expect(d.length).toBeWithin(43251, 5e3, 'jpeg image length');
169169
})
170170
.then(function() { return Plotly.toImage(gd, {format: 'svg', imageDataOnly: true}); })
171171
.then(function(d) {
172172
expect(d.indexOf('data:image/')).toBe(-1);
173-
expect(d.length).toBeWithin(39485, 1e3);
173+
expect(d.length).toBeWithin(39485, 1e3, 'svg image length');
174174
})
175175
.then(function() { return Plotly.toImage(gd, {format: 'webp', imageDataOnly: true}); })
176176
.then(function(d) {
177177
expect(d.indexOf('data:image/')).toBe(-1);
178-
expect(d.length).toBeWithin(15831, 1e3);
178+
expect(d.length).toBeWithin(15831, 1e3, 'webp image length');
179179
})
180180
.catch(fail)
181181
.then(done);

0 commit comments

Comments
 (0)