Skip to content

use new jasmine pattern for catching errors in async code #5372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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