Skip to content

Commit 61e4c19

Browse files
committed
filter mocks before calling testMock in loop:
- rm polar_scatter.json for now (it is showing some run-to-run randomness)
1 parent a3c21d5 commit 61e4c19

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

test/image/compare_pixels_test.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ function runAll () {
4040
* More info:
4141
* https://github.com/plotly/plotly.js/issues/62
4242
*
43-
* 40 test cases are removed:
43+
* 41 test cases are removed:
4444
* - font-wishlist (1 test case)
4545
* - all gl2d (38)
46-
* - gl2d_bunny-hull (1)
46+
* - gl3d_bunny-hull (1)
47+
* - polar_scatter (1)
4748
*/
48-
t.plan(allMocks.length - 40);
49+
var mocks = allMocks.filter(function(mock) {
50+
return !(
51+
mock === 'font-wishlist.json' ||
52+
mock.indexOf('gl2d') !== -1 ||
53+
mock === 'gl3d_bunny-hull.json' ||
54+
mock === 'polar_scatter.json'
55+
);
56+
});
4957

5058
var BASE_TIMEOUT = 500,
5159
BATCH_SIZE = 5,
@@ -55,6 +63,8 @@ function runAll () {
5563
setTimeout(function() {
5664
testMock(allMocks[cnt++], t);
5765
}, BASE_TIMEOUT * Math.floor(i / BATCH_SIZE) * BATCH_SIZE);
66+
t.plan(mocks.length);
67+
5868
}
5969

6070
});
@@ -68,15 +78,6 @@ function runSingle (userFileName) {
6878
}
6979

7080
function testMock (fileName, t) {
71-
if(path.extname(fileName) !== '.json') return;
72-
if(fileName === 'font-wishlist.json' && !userFileName) return;
73-
74-
// TODO fix race condition in gl2d image generation
75-
if(fileName.indexOf('gl2d_') !== -1) return;
76-
77-
// TODO fix run-to-run randomness
78-
if(fileName === 'gl3d_bunny-hull.json') return;
79-
8081
var figure = require(path.join(constants.pathToTestImageMocks, fileName));
8182
var bodyMock = {
8283
figure: figure,

0 commit comments

Comments
 (0)