Skip to content

Commit 45f4513

Browse files
authored
Merge pull request #5372 from plotly/drop-failTest
use new jasmine pattern for catching errors in async code
2 parents 444be40 + 13ef2bc commit 45f4513

File tree

106 files changed

+1967
-3733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1967
-3733
lines changed

test/jasmine/assets/domain_ref/components.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// test, we need a description of the test and the promise doing the test
88
// itself. In this case, it needs to tell jasmine if it passed or failed, so we
99
// pass in an assert function that the promise can call. Then in jasmine, the
10-
// promise is followed by .catch(failTest).then(done)
10+
// promise is followed by .then(done, done.fail)
1111
'use strict';
1212

1313
var Plotly = require('../../../../lib/index');

test/jasmine/bundle_tests/choropleth_test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var PlotlyChoropleth = require('@lib/choropleth');
55

66
var createGraphDiv = require('../assets/create_graph_div');
77
var destroyGraphDiv = require('../assets/destroy_graph_div');
8-
var failTest = require('../assets/fail_test');
8+
99

1010
var LONG_TIMEOUT_INTERVAL = 5 * jasmine.DEFAULT_TIMEOUT_INTERVAL;
1111

@@ -32,7 +32,6 @@ describe('Bundle with choropleth', function() {
3232

3333
expect(nodes.size()).toEqual(4);
3434
})
35-
.catch(failTest)
36-
.then(done);
35+
.then(done, done.fail);
3736
}, LONG_TIMEOUT_INTERVAL);
3837
});

test/jasmine/bundle_tests/dynamic_import_test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var Plotly = require('@lib/core');
33
var d3 = require('@plotly/d3');
44
var createGraphDiv = require('../assets/create_graph_div');
55
var destroyGraphDiv = require('../assets/destroy_graph_div');
6-
var failTest = require('../assets/fail_test');
6+
77

88
describe('Dynamic @lib/ module imports', function() {
99
var gd;
@@ -34,7 +34,6 @@ describe('Dynamic @lib/ module imports', function() {
3434
expect(polarLayer.size()).toBe(1, 'one polar layer');
3535
expect(polarLayer.selectAll('.trace').size()).toBe(1, 'one scatterpolar trace');
3636
})
37-
.catch(failTest)
38-
.then(done);
37+
.then(done, done.fail);
3938
});
4039
});

test/jasmine/bundle_tests/mathjax_test.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var d3 = require('@plotly/d3');
33

44
var createGraphDiv = require('../assets/create_graph_div');
55
var destroyGraphDiv = require('../assets/destroy_graph_div');
6-
var failTest = require('../assets/fail_test');
6+
77

88
describe('Test MathJax:', function() {
99
var mathJaxScriptTag;
@@ -95,8 +95,7 @@ describe('Test MathJax:', function() {
9595
}, {
9696
xCategories: longCats
9797
})
98-
.catch(failTest)
99-
.then(done);
98+
.then(done, done.fail);
10099
});
101100

102101
it('should scoot x-axis title (with MathJax) below x-axis ticks', function(done) {
@@ -115,8 +114,7 @@ describe('Test MathJax:', function() {
115114
}, {
116115
xCategories: longCats
117116
})
118-
.catch(failTest)
119-
.then(done);
117+
.then(done, done.fail);
120118
});
121119

122120
it('should scoot x-axis title below x-axis ticks (with MathJax)', function(done) {
@@ -136,8 +134,7 @@ describe('Test MathJax:', function() {
136134
}, {
137135
xCategories: longTexCats
138136
})
139-
.catch(failTest)
140-
.then(done);
137+
.then(done, done.fail);
141138
});
142139

143140
it('should scoot x-axis title (with MathJax) below x-axis ticks (with MathJax)', function(done) {
@@ -157,8 +154,7 @@ describe('Test MathJax:', function() {
157154
}, {
158155
xCategories: longTexCats
159156
})
160-
.catch(failTest)
161-
.then(done);
157+
.then(done, done.fail);
162158
});
163159
});
164160
});

test/jasmine/bundle_tests/no_webgl_test.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var Plotly = require('@lib');
22

33
var createGraphDiv = require('../assets/create_graph_div');
44
var destroyGraphDiv = require('../assets/destroy_graph_div');
5-
var failTest = require('../assets/fail_test');
5+
66

77
describe('Plotly w/o WebGL support:', function() {
88
var gd;
@@ -34,8 +34,7 @@ describe('Plotly w/o WebGL support:', function() {
3434
.then(function() {
3535
checkNoWebGLMsg(false);
3636
})
37-
.catch(failTest)
38-
.then(done);
37+
.then(done, done.fail);
3938
});
4039

4140
it('gl2d subplots', function(done) {
@@ -47,8 +46,7 @@ describe('Plotly w/o WebGL support:', function() {
4746
.then(function() {
4847
checkNoWebGLMsg(false);
4948
})
50-
.catch(failTest)
51-
.then(done);
49+
.then(done, done.fail);
5250
});
5351

5452
it('scattergl subplots', function(done) {
@@ -77,8 +75,7 @@ describe('Plotly w/o WebGL support:', function() {
7775
.then(function() {
7876
checkNoWebGLMsg(false);
7977
})
80-
.catch(failTest)
81-
.then(done);
78+
.then(done, done.fail);
8279
});
8380

8481
it('scatterpolargl subplots', function(done) {
@@ -90,8 +87,7 @@ describe('Plotly w/o WebGL support:', function() {
9087
.then(function() {
9188
checkNoWebGLMsg(false);
9289
})
93-
.catch(failTest)
94-
.then(done);
90+
.then(done, done.fail);
9591
});
9692

9793
it('splom subplots', function(done) {
@@ -103,8 +99,7 @@ describe('Plotly w/o WebGL support:', function() {
10399
.then(function() {
104100
checkNoWebGLMsg(false);
105101
})
106-
.catch(failTest)
107-
.then(done);
102+
.then(done, done.fail);
108103
});
109104

110105
it('parcoords subplots', function(done) {
@@ -116,7 +111,6 @@ describe('Plotly w/o WebGL support:', function() {
116111
.then(function() {
117112
checkNoWebGLMsg(false);
118113
})
119-
.catch(failTest)
120-
.then(done);
114+
.then(done, done.fail);
121115
});
122116
});

0 commit comments

Comments
 (0)