Skip to content

Commit

Permalink
Merge pull request #5372 from plotly/drop-failTest
Browse files Browse the repository at this point in the history
use new jasmine pattern for catching errors in async code
  • Loading branch information
archmoj authored Jan 5, 2021
2 parents 444be40 + 13ef2bc commit 45f4513
Show file tree
Hide file tree
Showing 106 changed files with 1,967 additions and 3,733 deletions.
2 changes: 1 addition & 1 deletion test/jasmine/assets/domain_ref/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// test, we need a description of the test and the promise doing the test
// itself. In this case, it needs to tell jasmine if it passed or failed, so we
// pass in an assert function that the promise can call. Then in jasmine, the
// promise is followed by .catch(failTest).then(done)
// promise is followed by .then(done, done.fail)
'use strict';

var Plotly = require('../../../../lib/index');
Expand Down
5 changes: 2 additions & 3 deletions test/jasmine/bundle_tests/choropleth_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var PlotlyChoropleth = require('@lib/choropleth');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var failTest = require('../assets/fail_test');


var LONG_TIMEOUT_INTERVAL = 5 * jasmine.DEFAULT_TIMEOUT_INTERVAL;

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

expect(nodes.size()).toEqual(4);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
}, LONG_TIMEOUT_INTERVAL);
});
5 changes: 2 additions & 3 deletions test/jasmine/bundle_tests/dynamic_import_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Plotly = require('@lib/core');
var d3 = require('@plotly/d3');
var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var failTest = require('../assets/fail_test');


describe('Dynamic @lib/ module imports', function() {
var gd;
Expand Down Expand Up @@ -34,7 +34,6 @@ describe('Dynamic @lib/ module imports', function() {
expect(polarLayer.size()).toBe(1, 'one polar layer');
expect(polarLayer.selectAll('.trace').size()).toBe(1, 'one scatterpolar trace');
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});
});
14 changes: 5 additions & 9 deletions test/jasmine/bundle_tests/mathjax_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var d3 = require('@plotly/d3');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var failTest = require('../assets/fail_test');


describe('Test MathJax:', function() {
var mathJaxScriptTag;
Expand Down Expand Up @@ -95,8 +95,7 @@ describe('Test MathJax:', function() {
}, {
xCategories: longCats
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('should scoot x-axis title (with MathJax) below x-axis ticks', function(done) {
Expand All @@ -115,8 +114,7 @@ describe('Test MathJax:', function() {
}, {
xCategories: longCats
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('should scoot x-axis title below x-axis ticks (with MathJax)', function(done) {
Expand All @@ -136,8 +134,7 @@ describe('Test MathJax:', function() {
}, {
xCategories: longTexCats
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('should scoot x-axis title (with MathJax) below x-axis ticks (with MathJax)', function(done) {
Expand All @@ -157,8 +154,7 @@ describe('Test MathJax:', function() {
}, {
xCategories: longTexCats
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});
});
});
20 changes: 7 additions & 13 deletions test/jasmine/bundle_tests/no_webgl_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var Plotly = require('@lib');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var failTest = require('../assets/fail_test');


describe('Plotly w/o WebGL support:', function() {
var gd;
Expand Down Expand Up @@ -34,8 +34,7 @@ describe('Plotly w/o WebGL support:', function() {
.then(function() {
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('gl2d subplots', function(done) {
Expand All @@ -47,8 +46,7 @@ describe('Plotly w/o WebGL support:', function() {
.then(function() {
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('scattergl subplots', function(done) {
Expand Down Expand Up @@ -77,8 +75,7 @@ describe('Plotly w/o WebGL support:', function() {
.then(function() {
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('scatterpolargl subplots', function(done) {
Expand All @@ -90,8 +87,7 @@ describe('Plotly w/o WebGL support:', function() {
.then(function() {
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('splom subplots', function(done) {
Expand All @@ -103,8 +99,7 @@ describe('Plotly w/o WebGL support:', function() {
.then(function() {
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});

it('parcoords subplots', function(done) {
Expand All @@ -116,7 +111,6 @@ describe('Plotly w/o WebGL support:', function() {
.then(function() {
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
.then(done, done.fail);
});
});
Loading

0 comments on commit 45f4513

Please sign in to comment.