@@ -3,7 +3,7 @@ var Registry = require('@src/registry');
33var Plots = Plotly . Plots ;
44var createGraphDiv = require ( '../assets/create_graph_div' ) ;
55var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
6- var fail = require ( '../assets/fail_test' ) ;
6+ var failTest = require ( '../assets/fail_test' ) ;
77var Lib = require ( '@src/lib' ) ;
88
99describe ( 'Plots.executeAPICommand' , function ( ) {
@@ -34,7 +34,9 @@ describe('Plots.executeAPICommand', function() {
3434 expect ( m . calls . argsFor ( 0 ) ) . toEqual ( [ gd , 'foo' , 'bar' ] ) ;
3535
3636 expect ( value ) . toEqual ( 'resolution' ) ;
37- } ) . catch ( fail ) . then ( done ) ;
37+ } )
38+ . catch ( failTest )
39+ . then ( done ) ;
3840 } ) ;
3941
4042 } ) ;
@@ -47,22 +49,24 @@ describe('Plots.executeAPICommand', function() {
4749 } ) ;
4850
4951 it ( 'calls the API method and rejects' , function ( done ) {
50- Plots . executeAPICommand ( gd , 'restyle' , [ 'foo' , 'bar' ] ) . then ( fail , function ( value ) {
52+ Plots . executeAPICommand ( gd , 'restyle' , [ 'foo' , 'bar' ] ) . then ( failTest , function ( value ) {
5153 var m = Registry . apiMethodRegistry . restyle ;
5254 expect ( m ) . toHaveBeenCalled ( ) ;
5355 expect ( m . calls . count ( ) ) . toEqual ( 1 ) ;
5456 expect ( m . calls . argsFor ( 0 ) ) . toEqual ( [ gd , 'foo' , 'bar' ] ) ;
5557
5658 expect ( value ) . toEqual ( 'rejection' ) ;
57- } ) . catch ( fail ) . then ( done ) ;
59+ } )
60+ . catch ( failTest )
61+ . then ( done ) ;
5862 } ) ;
5963
6064 } ) ;
6165
6266 describe ( 'with the skip command' , function ( ) {
6367 it ( 'resolves immediately' , function ( done ) {
6468 Plots . executeAPICommand ( gd , 'skip' )
65- . catch ( fail ) . then ( done ) ;
69+ . catch ( failTest ) . then ( done ) ;
6670 } ) ;
6771 } ) ;
6872} ) ;
@@ -514,7 +518,9 @@ describe('component bindings', function() {
514518 return Plotly . restyle ( gd , 'marker.width' , 8 ) ;
515519 } ) . then ( function ( ) {
516520 expect ( count ) . toEqual ( 1 ) ;
517- } ) . catch ( fail ) . then ( done ) ;
521+ } )
522+ . catch ( failTest )
523+ . then ( done ) ;
518524 } ) ;
519525
520526 it ( 'logs a warning if unable to create an observer' , function ( ) {
@@ -536,15 +542,19 @@ describe('component bindings', function() {
536542
537543 Plotly . restyle ( gd , 'marker.color' , 'blue' ) . then ( function ( ) {
538544 expect ( gd . layout . sliders [ 0 ] . active ) . toBe ( 4 ) ;
539- } ) . catch ( fail ) . then ( done ) ;
545+ } )
546+ . catch ( failTest )
547+ . then ( done ) ;
540548 } ) ;
541549
542550 it ( 'does not update the component if the value is not present' , function ( done ) {
543551 expect ( gd . layout . sliders [ 0 ] . active ) . toBe ( 0 ) ;
544552
545553 Plotly . restyle ( gd , 'marker.color' , 'black' ) . then ( function ( ) {
546554 expect ( gd . layout . sliders [ 0 ] . active ) . toBe ( 0 ) ;
547- } ) . catch ( fail ) . then ( done ) ;
555+ } )
556+ . catch ( failTest )
557+ . then ( done ) ;
548558 } ) ;
549559
550560 it ( 'udpates bound components when the computed value changes' , function ( done ) {
@@ -555,7 +565,9 @@ describe('component bindings', function() {
555565 // nonetheless is bound by value to the component.
556566 Plotly . restyle ( gd , 'line.color' , 'blue' ) . then ( function ( ) {
557567 expect ( gd . layout . sliders [ 0 ] . active ) . toBe ( 4 ) ;
558- } ) . catch ( fail ) . then ( done ) ;
568+ } )
569+ . catch ( failTest )
570+ . then ( done ) ;
559571 } ) ;
560572} ) ;
561573
@@ -623,7 +635,9 @@ describe('attaching component bindings', function() {
623635 // Bindings are no longer simple, so check to ensure they have
624636 // been removed
625637 expect ( gd . _internalEv . _events . plotly_animatingframe ) . toBeUndefined ( ) ;
626- } ) . catch ( fail ) . then ( done ) ;
638+ } )
639+ . catch ( failTest )
640+ . then ( done ) ;
627641 } ) ;
628642
629643 it ( 'attaches and updates bindings for updatemenus' , function ( done ) {
@@ -676,6 +690,8 @@ describe('attaching component bindings', function() {
676690 // Bindings are no longer simple, so check to ensure they have
677691 // been removed
678692 expect ( gd . _internalEv . _events . plotly_animatingframe ) . toBeUndefined ( ) ;
679- } ) . catch ( fail ) . then ( done ) ;
693+ } )
694+ . catch ( failTest )
695+ . then ( done ) ;
680696 } ) ;
681697} ) ;
0 commit comments