Skip to content

Commit 8433627

Browse files
committed
replace beforeEach-afterEach TIMEOUT_INTERVAL hack by it-arg
- see jasmine/jasmine@68ba5b6
1 parent b43cba4 commit 8433627

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

test/jasmine/tests/download_test.js

+6-12
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ var createGraphDiv = require('../assets/create_graph_div');
33
var destroyGraphDiv = require('../assets/destroy_graph_div');
44
var textchartMock = require('@mocks/text_chart_arrays.json');
55

6+
var LONG_TIMEOUT_INTERVAL = 2 * jasmine.DEFAULT_TIMEOUT_INTERVAL;
7+
68
describe('Plotly.downloadImage', function() {
79
'use strict';
810
var gd;
9-
var originalTimeout;
1011

1112
// override click handler on createElement
1213
// so these tests will not actually
@@ -27,16 +28,10 @@ describe('Plotly.downloadImage', function() {
2728

2829
beforeEach(function() {
2930
gd = createGraphDiv();
30-
31-
// downloadImage can take a little longer
32-
// so give it a little more time to finish
33-
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
34-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
3531
});
3632

3733
afterEach(function() {
3834
destroyGraphDiv();
39-
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
4035
});
4136

4237
it('should be attached to Plotly', function() {
@@ -45,11 +40,11 @@ describe('Plotly.downloadImage', function() {
4540

4641
it('should create link, remove link, accept options', function(done) {
4742
downloadTest(gd, 'jpeg', done);
48-
});
43+
}, LONG_TIMEOUT_INTERVAL);
4944

5045
it('should create link, remove link, accept options', function(done) {
5146
downloadTest(gd, 'png', done);
52-
});
47+
}, LONG_TIMEOUT_INTERVAL);
5348

5449
it('should create link, remove link, accept options', function(done) {
5550
checkWebp(function(supported) {
@@ -59,12 +54,11 @@ describe('Plotly.downloadImage', function() {
5954
done();
6055
}
6156
});
62-
63-
});
57+
}, LONG_TIMEOUT_INTERVAL);
6458

6559
it('should create link, remove link, accept options', function(done) {
6660
downloadTest(gd, 'svg', done);
67-
});
61+
}, LONG_TIMEOUT_INTERVAL);
6862
});
6963

7064

0 commit comments

Comments
 (0)