diff --git a/test/jasmine/tests/command_test.js b/test/jasmine/tests/command_test.js index fe02f8812ca..05d9845370e 100644 --- a/test/jasmine/tests/command_test.js +++ b/test/jasmine/tests/command_test.js @@ -3,7 +3,7 @@ var Registry = require('@src/registry'); var Plots = Plotly.Plots; var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var Lib = require('@src/lib'); describe('Plots.executeAPICommand', function() { @@ -34,7 +34,9 @@ describe('Plots.executeAPICommand', function() { expect(m.calls.argsFor(0)).toEqual([gd, 'foo', 'bar']); expect(value).toEqual('resolution'); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); }); @@ -47,14 +49,16 @@ describe('Plots.executeAPICommand', function() { }); it('calls the API method and rejects', function(done) { - Plots.executeAPICommand(gd, 'restyle', ['foo', 'bar']).then(fail, function(value) { + Plots.executeAPICommand(gd, 'restyle', ['foo', 'bar']).then(failTest, function(value) { var m = Registry.apiMethodRegistry.restyle; expect(m).toHaveBeenCalled(); expect(m.calls.count()).toEqual(1); expect(m.calls.argsFor(0)).toEqual([gd, 'foo', 'bar']); expect(value).toEqual('rejection'); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); }); @@ -62,7 +66,7 @@ describe('Plots.executeAPICommand', function() { describe('with the skip command', function() { it('resolves immediately', function(done) { Plots.executeAPICommand(gd, 'skip') - .catch(fail).then(done); + .catch(failTest).then(done); }); }); }); @@ -514,7 +518,9 @@ describe('component bindings', function() { return Plotly.restyle(gd, 'marker.width', 8); }).then(function() { expect(count).toEqual(1); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('logs a warning if unable to create an observer', function() { @@ -536,7 +542,9 @@ describe('component bindings', function() { Plotly.restyle(gd, 'marker.color', 'blue').then(function() { expect(gd.layout.sliders[0].active).toBe(4); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('does not update the component if the value is not present', function(done) { @@ -544,7 +552,9 @@ describe('component bindings', function() { Plotly.restyle(gd, 'marker.color', 'black').then(function() { expect(gd.layout.sliders[0].active).toBe(0); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('udpates bound components when the computed value changes', function(done) { @@ -555,7 +565,9 @@ describe('component bindings', function() { // nonetheless is bound by value to the component. Plotly.restyle(gd, 'line.color', 'blue').then(function() { expect(gd.layout.sliders[0].active).toBe(4); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); }); @@ -623,7 +635,9 @@ describe('attaching component bindings', function() { // Bindings are no longer simple, so check to ensure they have // been removed expect(gd._internalEv._events.plotly_animatingframe).toBeUndefined(); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('attaches and updates bindings for updatemenus', function(done) { @@ -676,6 +690,8 @@ describe('attaching component bindings', function() { // Bindings are no longer simple, so check to ensure they have // been removed expect(gd._internalEv._events.plotly_animatingframe).toBeUndefined(); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); }); diff --git a/test/jasmine/tests/download_test.js b/test/jasmine/tests/download_test.js index b8844e63f47..1780388c774 100644 --- a/test/jasmine/tests/download_test.js +++ b/test/jasmine/tests/download_test.js @@ -2,7 +2,7 @@ var Plotly = require('@lib/index'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); var textchartMock = require('@mocks/text_chart_arrays.json'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var Lib = require('@src/lib'); @@ -106,7 +106,7 @@ describe('Plotly.downloadImage', function() { reader.readAsText(savedBlob); }); }) - .catch(fail) + .catch(failTest) .then(done); }, LONG_TIMEOUT_INTERVAL); }); diff --git a/test/jasmine/tests/drawing_test.js b/test/jasmine/tests/drawing_test.js index d62d2fdea73..414f2239b26 100644 --- a/test/jasmine/tests/drawing_test.js +++ b/test/jasmine/tests/drawing_test.js @@ -4,7 +4,7 @@ var Drawing = require('@src/components/drawing'); var svgTextUtils = require('@src/lib/svg_text_utils'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); describe('Drawing', function() { 'use strict'; @@ -422,7 +422,7 @@ describe('Drawing', function() { bottom: 4 }); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -546,7 +546,7 @@ describe('gradients', function() { // full replot and no resulting markers at all -> no gradients checkGradientIds([], [], [], []); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/errorbars_test.js b/test/jasmine/tests/errorbars_test.js index 6cf7a1ea900..6fdf50da780 100644 --- a/test/jasmine/tests/errorbars_test.js +++ b/test/jasmine/tests/errorbars_test.js @@ -3,7 +3,7 @@ var Plotly = require('@lib/index'); var d3 = require('d3'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); describe('errorbar plotting', function() { @@ -61,7 +61,7 @@ describe('errorbar plotting', function() { .then(function() { check([-0.6667, 2.6667], [-0.2629, 4.9949], 3, 3); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -97,7 +97,7 @@ describe('errorbar plotting', function() { {xs: 10, xh: 18} ]); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/frame_api_test.js b/test/jasmine/tests/frame_api_test.js index bcd9bee1bd5..8818e442904 100644 --- a/test/jasmine/tests/frame_api_test.js +++ b/test/jasmine/tests/frame_api_test.js @@ -3,7 +3,7 @@ var Lib = require('@src/lib'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); describe('Test frame api', function() { 'use strict'; @@ -72,50 +72,66 @@ describe('Test frame api', function() { .then(function() { // Five (`var numericNameWarningCountLimit = 5`) warnings and one warning saying that there won't be more warnings expect(Lib.warn.calls.count()).toEqual(5 + 1); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('treats an undefined list as a noop', function(done) { Plotly.addFrames(gd, undefined).then(function() { expect(Object.keys(h)).toEqual([]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('compresses garbage when adding frames', function(done) { Plotly.addFrames(gd, [null, 'garbage', 14, true, false, {name: 'test'}, null]).then(function() { expect(Object.keys(h)).toEqual(['test']); expect(f).toEqual([{name: 'test'}]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('treats a null list as a noop', function(done) { Plotly.addFrames(gd, null).then(function() { expect(Object.keys(h)).toEqual([]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('treats an empty list as a noop', function(done) { Plotly.addFrames(gd, []).then(function() { expect(Object.keys(h)).toEqual([]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('names an unnamed frame', function(done) { Plotly.addFrames(gd, [{}]).then(function() { expect(Object.keys(h)).toEqual(['frame 0']); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('casts names to strings', function(done) { Plotly.addFrames(gd, [{name: 5}]).then(function() { expect(Object.keys(h)).toEqual(['5']); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('creates multiple unnamed frames at the same time', function(done) { Plotly.addFrames(gd, [{}, {}]).then(function() { expect(f).toEqual([{name: 'frame 0'}, {name: 'frame 1'}]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('creates multiple unnamed frames in series', function(done) { @@ -123,13 +139,17 @@ describe('Test frame api', function() { return Plotly.addFrames(gd, [{}]); }).then(function() { expect(f).toEqual([{name: 'frame 0'}, {name: 'frame 1'}]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('casts number names to strings on insertion', function(done) { Plotly.addFrames(gd, [{name: 2}]).then(function() { expect(f).toEqual([{name: '2'}]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('updates frames referenced by number', function(done) { @@ -137,7 +157,9 @@ describe('Test frame api', function() { return Plotly.addFrames(gd, [{name: 2, layout: {foo: 'bar'}}]); }).then(function() { expect(f).toEqual([{name: '2', layout: {foo: 'bar'}}]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('avoids name collisions', function(done) { @@ -147,7 +169,9 @@ describe('Test frame api', function() { return Plotly.addFrames(gd, [{}, {name: 'foobar'}, {}]); }).then(function() { expect(f).toEqual([{name: 'frame 0'}, {name: 'frame 2'}, {name: 'frame 1'}, {name: 'foobar'}, {name: 'frame 3'}]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('inserts frames at specific indices', function(done) { @@ -171,7 +195,10 @@ describe('Test frame api', function() { expect(f[10]).toEqual({name: 'frame10', data: [3]}); return Plotly.Queue.undo(gd); - }).then(validate).catch(fail).then(done); + }) + .then(validate) + .catch(failTest) + .then(done); }); it('inserts frames at specific indices (reversed)', function(done) { @@ -195,7 +222,10 @@ describe('Test frame api', function() { expect(f[10]).toEqual({name: 'frame10', data: [3]}); return Plotly.Queue.undo(gd); - }).then(validate).catch(fail).then(done); + }) + .then(validate) + .catch(failTest) + .then(done); }); it('implements undo/redo', function(done) { @@ -211,7 +241,10 @@ describe('Test frame api', function() { expect(h).toEqual({}); return Plotly.Queue.redo(gd); - }).then(validate).catch(fail).then(done); + }) + .then(validate) + .catch(failTest) + .then(done); }); it('overwrites frames', function(done) { @@ -234,7 +267,9 @@ describe('Test frame api', function() { }).then(function() { expect(f).toEqual([{name: 'test1'}, {name: 'test2'}, {name: 'test3'}]); expect(Object.keys(h)).toEqual(['test1', 'test2', 'test3']); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); }); @@ -257,7 +292,9 @@ describe('Test frame api', function() { }).then(function() { expect(f).toEqual([]); expect(Object.keys(h)).toEqual([]); - }).catch(fail).then(done); + }) + .catch(failTest) + .then(done); }); it('deletes multiple frames', function(done) { @@ -285,7 +322,10 @@ describe('Test frame api', function() { } return Plotly.Queue.redo(gd); - }).then(validate).catch(fail).then(done); + }) + .then(validate) + .catch(failTest) + .then(done); }); it('deletes all frames if frameList is falsey', function(done) { @@ -317,7 +357,10 @@ describe('Test frame api', function() { }).then(validateCount(n)).then(function() { // Delete with undefined: return Plotly.deleteFrames(gd, undefined); - }).then(validateCount(0)).catch(fail).then(done); + }) + .then(validateCount(0)) + .catch(failTest) + .then(done); }); it('deleteFrames is a no-op with empty array', function(done) { @@ -337,7 +380,10 @@ describe('Test frame api', function() { Plotly.addFrames(gd, frames).then(function() { // Delete with no args: return Plotly.deleteFrames(gd, []); - }).then(validateCount(n)).catch(fail).then(done); + }) + .then(validateCount(n)) + .catch(failTest) + .then(done); }); }); }); diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index a757fd4debd..a05edfbcdca 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -7,7 +7,7 @@ var Drawing = require('@src/components/drawing'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var mouseEvent = require('../assets/mouse_event'); var touchEvent = require('../assets/touch_event'); var selectButton = require('../assets/modebar_button'); @@ -213,7 +213,7 @@ describe('@gl Test gl3d plots', function() { .then(function() { assertHoverText(null, null, '100k'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -388,7 +388,7 @@ describe('@gl Test gl3d plots', function() { .then(function() { assertHoverText(null, null, null, 'yo!'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -817,7 +817,7 @@ describe('@gl Test gl3d drag and wheel interactions', function() { .then(function() { expect(relayoutCallback).toHaveBeenCalledTimes(3); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -908,7 +908,7 @@ describe('@gl Test gl3d drag and wheel interactions', function() { .then(function() { expect(relayoutCallback).toHaveBeenCalledTimes(2); }) - .catch(fail) + .catch(failTest) .then(done); }); }); @@ -956,7 +956,7 @@ describe('@gl Test gl3d relayout calls', function() { .then(function() { assertMargins(0, 0, 0, 0); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -974,7 +974,7 @@ describe('@gl Test gl3d relayout calls', function() { zaxis: {} }); }) - .catch(fail) + .catch(failTest) .then(done); }); }); @@ -1063,7 +1063,7 @@ describe('@gl Test gl3d annotations', function() { .then(function() { assertAnnotationsXY([[262, 199], [257, 135], [325, 233]], 'base 0'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -1096,7 +1096,7 @@ describe('@gl Test gl3d annotations', function() { .then(function() { assertAnnotationText(['0', '1', '2', '3', '4', '5', '6'], 'back to base after zaxis range relayout'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -1146,7 +1146,7 @@ describe('@gl Test gl3d annotations', function() { .then(function() { assertAnnotationText(['new!'], 'after add new (2)'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -1199,7 +1199,7 @@ describe('@gl Test gl3d annotations', function() { assertAnnotationCntPerScene('scene', 1); assertAnnotationCntPerScene('scene2', 2); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -1233,7 +1233,7 @@ describe('@gl Test gl3d annotations', function() { .then(function() { assertSceneAxisRanges([0.9375, 3.0625], [0.9375, 3.0625], [0.7187, 10.2813]); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -1302,7 +1302,7 @@ describe('@gl Test gl3d annotations', function() { 'scene.annotations[0].ay': -80 }); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -1352,7 +1352,7 @@ describe('@gl Test gl3d annotations', function() { dispatch('click'); }); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/gl3dlayout_test.js b/test/jasmine/tests/gl3dlayout_test.js index 2540a53a6f5..dda88208001 100644 --- a/test/jasmine/tests/gl3dlayout_test.js +++ b/test/jasmine/tests/gl3dlayout_test.js @@ -6,7 +6,7 @@ var Color = require('@src/components/color'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); describe('Test Gl3d layout defaults', function() { @@ -300,7 +300,7 @@ describe('Gl3d layout edge cases', function() { expect(aspect.y).toBeCloseTo(0.6437); expect(aspect.z).toBeCloseTo(0.9655); }) - .catch(fail) + .catch(failTest) .then(done); }); diff --git a/test/jasmine/tests/histogram2d_test.js b/test/jasmine/tests/histogram2d_test.js index a2c68903c17..3950324aeb5 100644 --- a/test/jasmine/tests/histogram2d_test.js +++ b/test/jasmine/tests/histogram2d_test.js @@ -6,7 +6,7 @@ var calc = require('@src/traces/histogram2d/calc'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var supplyAllDefaults = require('../assets/supply_defaults'); describe('Test histogram2d', function() { @@ -178,7 +178,7 @@ describe('Test histogram2d', function() { .then(function() { return Plotly.relayout(gd, 'xaxis.range', [0, 2]); }) - .catch(fail) + .catch(failTest) .then(done); }); diff --git a/test/jasmine/tests/hover_spikeline_test.js b/test/jasmine/tests/hover_spikeline_test.js index 4720ddfc8a5..ebab394fdad 100644 --- a/test/jasmine/tests/hover_spikeline_test.js +++ b/test/jasmine/tests/hover_spikeline_test.js @@ -4,7 +4,7 @@ var Plotly = require('@lib/index'); var Fx = require('@src/components/fx'); var Lib = require('@src/lib'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); @@ -87,7 +87,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -109,7 +109,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -132,7 +132,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -152,7 +152,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -180,7 +180,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -215,7 +215,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -250,7 +250,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -286,7 +286,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -322,7 +322,7 @@ describe('spikeline hover', function() { [] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -367,7 +367,7 @@ describe('spikeline hover', function() { .then(_assertBarSpikes) .then(function() { _set_hovermode('closest'); }) .then(_assertBarSpikes) - .catch(fail) + .catch(failTest) .then(done); }); @@ -392,7 +392,7 @@ describe('spikeline hover', function() { [[200, 500], [100, 400]] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -421,7 +421,7 @@ describe('spikeline hover', function() { [[200, 500], [100, 400]] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -437,7 +437,7 @@ describe('spikeline hover', function() { [[200, 500], [100, 400]] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -456,7 +456,7 @@ describe('spikeline hover', function() { [[200, 500], [100, 400]] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -476,7 +476,7 @@ describe('spikeline hover', function() { [[200, 500], [100, 400]] ); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/mesh3d_test.js b/test/jasmine/tests/mesh3d_test.js index 982c7913765..2375061f915 100644 --- a/test/jasmine/tests/mesh3d_test.js +++ b/test/jasmine/tests/mesh3d_test.js @@ -1,7 +1,7 @@ var Plotly = require('@lib'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); describe('Test mesh3d restyle', function() { afterEach(destroyGraphDiv); @@ -51,7 +51,7 @@ describe('Test mesh3d restyle', function() { return Plotly.purge(gd); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/page_test.js b/test/jasmine/tests/page_test.js index a7948a4a9c1..65a672f8d21 100644 --- a/test/jasmine/tests/page_test.js +++ b/test/jasmine/tests/page_test.js @@ -4,7 +4,7 @@ var Lib = require('@src/lib'); var d3 = require('d3'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); describe('page rendering', function() { @@ -82,7 +82,7 @@ describe('page rendering', function() { expect(bBox.height).toBe(0); }); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/plots_test.js b/test/jasmine/tests/plots_test.js index 244b3dccf6d..4b5139bf818 100644 --- a/test/jasmine/tests/plots_test.js +++ b/test/jasmine/tests/plots_test.js @@ -5,7 +5,6 @@ var Lib = require('@src/lib'); var d3 = require('d3'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); var supplyAllDefaults = require('../assets/supply_defaults'); var failTest = require('../assets/fail_test'); @@ -763,7 +762,7 @@ describe('Test Plots', function() { // some special Plots.style logic. expect(Drawing.pointStyle).toHaveBeenCalledTimes(3); }) - .catch(fail) + .catch(failTest) .then(done); }); }); @@ -829,7 +828,7 @@ describe('Test Plots', function() { .then(function() { assertSubplots({cartesian: ['xy']}, 'totally blank'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -838,7 +837,7 @@ describe('Test Plots', function() { .then(function() { assertSubplots({cartesian: ['x3y4']}, 'blank with axis objects'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -856,7 +855,7 @@ describe('Test Plots', function() { .then(function() { assertSubplots({cartesian: ['xy', 'x2y2', 'x3y3', 'x5y5']}, 'visible components'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -874,7 +873,7 @@ describe('Test Plots', function() { .then(function() { assertSubplots({cartesian: ['xy', 'x2y2', 'x3y3', 'x5y5']}, 'invisible components'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -893,7 +892,7 @@ describe('Test Plots', function() { .then(function() { assertSubplots({pie: 1}, 'just pie'); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/sankey_test.js b/test/jasmine/tests/sankey_test.js index acc644643b3..d29d1967bc0 100644 --- a/test/jasmine/tests/sankey_test.js +++ b/test/jasmine/tests/sankey_test.js @@ -8,7 +8,7 @@ var Sankey = require('@src/traces/sankey'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var mouseEvent = require('../assets/mouse_event'); var assertHoverLabelStyle = require('../assets/custom_assertions').assertHoverLabelStyle; var supplyAllDefaults = require('../assets/supply_defaults'); @@ -455,7 +455,7 @@ describe('sankey tests', function() { ['rgb(255, 0, 0)', 'rgb(0, 0, 255)', 20, 'Roboto', 'rgb(0, 0, 0)'] ); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -479,7 +479,7 @@ describe('sankey tests', function() { ['rgb(0, 0, 96)', 'rgb(255, 255, 255)', 13, 'Arial', 'rgb(255, 255, 255)'] ); }) - .catch(fail) + .catch(failTest) .then(done); }); }); @@ -588,7 +588,7 @@ describe('sankey tests', function() { value: 46.477 }); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/scattermapbox_test.js b/test/jasmine/tests/scattermapbox_test.js index 70234c89bcf..7293b2bb5e5 100644 --- a/test/jasmine/tests/scattermapbox_test.js +++ b/test/jasmine/tests/scattermapbox_test.js @@ -7,7 +7,7 @@ var convert = require('@src/traces/scattermapbox/convert'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var supplyAllDefaults = require('../assets/supply_defaults'); var mouseEvent = require('../assets/mouse_event'); @@ -773,7 +773,7 @@ describe('@noCI scattermapbox hover', function() { .then(function() { check('(10°, 10°)
Apple'); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/scatterpolar_test.js b/test/jasmine/tests/scatterpolar_test.js index a8ee1c0945e..14d2ea0a954 100644 --- a/test/jasmine/tests/scatterpolar_test.js +++ b/test/jasmine/tests/scatterpolar_test.js @@ -4,7 +4,7 @@ var ScatterPolar = require('@src/traces/scatterpolar'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var mouseEvent = require('../assets/mouse_event'); var customAssertions = require('../assets/custom_assertions'); @@ -153,7 +153,7 @@ describe('Test scatterpolar hover:', function() { }] .forEach(function(specs) { it('should generate correct hover labels ' + specs.desc, function(done) { - run(specs).catch(fail).then(done); + run(specs).catch(failTest).then(done); }); }); }); diff --git a/test/jasmine/tests/scatterpolargl_test.js b/test/jasmine/tests/scatterpolargl_test.js index a3e68af50a6..01b2087cca1 100644 --- a/test/jasmine/tests/scatterpolargl_test.js +++ b/test/jasmine/tests/scatterpolargl_test.js @@ -3,7 +3,7 @@ var Lib = require('@src/lib'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var mouseEvent = require('../assets/mouse_event'); var customAssertions = require('../assets/custom_assertions'); @@ -82,7 +82,7 @@ describe('Test scatterpolargl hover:', function() { }] .forEach(function(specs) { it('should generate correct hover labels ' + specs.desc, function(done) { - run(specs).catch(fail).then(done); + run(specs).catch(failTest).then(done); }); }); }); diff --git a/test/jasmine/tests/scatterternary_test.js b/test/jasmine/tests/scatterternary_test.js index 932f03c9485..03fcffc71c0 100644 --- a/test/jasmine/tests/scatterternary_test.js +++ b/test/jasmine/tests/scatterternary_test.js @@ -5,7 +5,7 @@ var ScatterTernary = require('@src/traces/scatterternary'); var d3 = require('d3'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var customAssertions = require('../assets/custom_assertions'); var supplyAllDefaults = require('../assets/supply_defaults'); @@ -398,6 +398,7 @@ describe('scatterternary hover', function() { expect(scatterPointData[0].yLabelVal).toBeUndefined(); expect(scatterPointData[0].text).toEqual('orange'); }) + .catch(failTest) .then(done); }); @@ -503,7 +504,7 @@ describe('Test scatterternary *cliponaxis*', function() { [true, 1] ); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/ternary_test.js b/test/jasmine/tests/ternary_test.js index 1c9cc67de3e..8bd9847049a 100644 --- a/test/jasmine/tests/ternary_test.js +++ b/test/jasmine/tests/ternary_test.js @@ -6,7 +6,7 @@ var supplyLayoutDefaults = require('@src/plots/ternary/layout/defaults'); var d3 = require('d3'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var mouseEvent = require('../assets/mouse_event'); var click = require('../assets/click'); var doubleClick = require('../assets/double_click'); @@ -168,7 +168,7 @@ describe('ternary plots', function() { fontFamily: 'Gravitas' }, 'after hoverlabel styling restyle call'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -345,7 +345,7 @@ describe('ternary plots', function() { .then(function() { _assert(dflt); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -378,7 +378,7 @@ describe('ternary plots', function() { .then(function() { _assert('Roboto', 'rgb(255, 0, 0)', 20); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -406,7 +406,7 @@ describe('ternary plots', function() { expect(subplot.aaxis._offset < 0).toBe(true); expect(subplot.caxis._offset < 0).toBe(true); }) - .catch(fail) + .catch(failTest) .then(done); }); diff --git a/test/jasmine/tests/toimage_test.js b/test/jasmine/tests/toimage_test.js index 40e5a4601a9..3110a1f38df 100644 --- a/test/jasmine/tests/toimage_test.js +++ b/test/jasmine/tests/toimage_test.js @@ -3,7 +3,7 @@ var Lib = require('@src/lib'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var subplotMock = require('@mocks/multiple_subplots.json'); var FORMATS = ['png', 'jpeg', 'webp', 'svg']; @@ -66,7 +66,7 @@ describe('Plotly.toImage', function() { expect(function() { Plotly.toImage(gd, {format: 'x'}); }) .toThrow(new Error('Image format is not jpeg, png, svg or webp.')); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -82,7 +82,7 @@ describe('Plotly.toImage', function() { expect(function() { Plotly.toImage(gd, {width: 0.5}); }) .toThrow(new Error('Height and width should be pixel values.')); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -110,7 +110,7 @@ describe('Plotly.toImage', function() { expect(img.height).toBe(400); expect(img.width).toBe(400); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -138,7 +138,7 @@ describe('Plotly.toImage', function() { .then(function(url) { expect(url.split('webp')[0]).toBe('data:image/'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -166,7 +166,7 @@ describe('Plotly.toImage', function() { expect(d.indexOf('data:image/')).toBe(-1); expect(d.length).toBeWithin(15831, 1e3, 'webp image length'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -179,7 +179,7 @@ describe('Plotly.toImage', function() { .then(function(url) { return assertSize(url, 1400, 900); }) .then(function() { return Plotly.toImage(gd, {format: f, scale: 0.5}); }) .then(function(url) { return assertSize(url, 350, 225); }) - .catch(fail) + .catch(failTest) .then(done); }); }); @@ -193,7 +193,7 @@ describe('Plotly.toImage', function() { expect(img.width).toBe(700); expect(img.height).toBe(450); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -207,7 +207,7 @@ describe('Plotly.toImage', function() { expect(img.width).toBe(700); expect(img.height).toBe(450); }) - .catch(fail) + .catch(failTest) .then(done); }); }); diff --git a/test/jasmine/tests/transform_sort_test.js b/test/jasmine/tests/transform_sort_test.js index fca82e09c24..ebe8c3e6eae 100644 --- a/test/jasmine/tests/transform_sort_test.js +++ b/test/jasmine/tests/transform_sort_test.js @@ -5,7 +5,7 @@ var Lib = require('@src/lib'); var d3 = require('d3'); var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); -var fail = require('../assets/fail_test'); +var failTest = require('../assets/fail_test'); var mouseEvent = require('../assets/mouse_event'); var supplyAllDefaults = require('../assets/supply_defaults'); @@ -291,7 +291,7 @@ describe('Test sort transform interactions:', function() { .then(function() { _assertFirst('M10,0A10,10 0 1'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -383,7 +383,7 @@ describe('Test sort transform interactions:', function() { .then(function(eventData) { assertPt(eventData, 1, 1, 5, 'G'); }) - .catch(fail) + .catch(failTest) .then(done); }); @@ -420,7 +420,7 @@ describe('Test sort transform interactions:', function() { .then(function() { expect(gd._fullLayout.xaxis._categories).toEqual(['A', 'B', 'C']); }) - .catch(fail) + .catch(failTest) .then(done); }); });