Skip to content

Commit bb351c8

Browse files
committed
refactor loop over describe in transition test
1 parent dc3c342 commit bb351c8

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

test/jasmine/tests/transition_test.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ var destroyGraphDiv = require('../assets/destroy_graph_div');
1212
var delay = require('../assets/delay');
1313
var mock = require('@mocks/animation');
1414

15-
function runTests(transitionDuration) {
15+
[0, 20].forEach(function(transitionDuration) {
16+
// Run the whole set of tests twice: once with zero duration and once with
17+
// nonzero duration since the behavior should be identical, but there's a
18+
// very real possibility of race conditions or other timing issues.
19+
//
20+
// And of course, remember to put the async loop in a closure:
21+
1622
describe('Plots.transition (duration = ' + transitionDuration + ')', function() {
1723
'use strict';
1824

@@ -258,17 +264,8 @@ function runTests(transitionDuration) {
258264
.then(done, done.fail);
259265
});
260266
});
261-
}
267+
});
262268

263-
for(var i = 0; i < 2; i++) {
264-
var duration = i * 20;
265-
// Run the whole set of tests twice: once with zero duration and once with
266-
// nonzero duration since the behavior should be identical, but there's a
267-
// very real possibility of race conditions or other timing issues.
268-
//
269-
// And of course, remember to put the async loop in a closure:
270-
runTests(duration);
271-
}
272269

273270
describe('Plotly.react transitions:', function() {
274271
var gd;

0 commit comments

Comments
 (0)