@@ -759,35 +759,35 @@ describe('Job', () => {
759759
760760 it ( 'applies stacktrace limit on failure' , ( ) => {
761761 const stackTraceLimit = 1 ;
762- return Job . create ( queue , { foo : 'bar' } , { stackTraceLimit , attempts : 2 } ) . then (
763- job => {
764- return job
765- . isFailed ( )
766- . then ( isFailed => {
767- expect ( isFailed ) . to . be ( false ) ;
768- } )
769- . then ( ( ) => {
770- return scripts . moveToActive ( queue ) ;
771- } )
772- . then ( ( ) => {
773- return job . moveToFailed ( new Error ( 'test error' ) , true ) ;
774- } )
775- . then ( ( ) => {
776- return scripts . moveToActive ( queue ) ;
777- } )
778- . then ( ( ) => {
779- return job
780- . moveToFailed ( new Error ( 'test error' ) , true )
781- . then ( ( ) => {
782- return job . isFailed ( ) . then ( isFailed => {
783- expect ( isFailed ) . to . be ( true ) ;
784- expect ( job . stacktrace ) . not . be ( null ) ;
785- expect ( job . stacktrace . length ) . to . be ( stackTraceLimit ) ;
786- } ) ;
787- } ) ;
762+ return Job . create (
763+ queue ,
764+ { foo : 'bar' } ,
765+ { stackTraceLimit , attempts : 2 }
766+ ) . then ( job => {
767+ return job
768+ . isFailed ( )
769+ . then ( isFailed => {
770+ expect ( isFailed ) . to . be ( false ) ;
771+ } )
772+ . then ( ( ) => {
773+ return scripts . moveToActive ( queue ) ;
774+ } )
775+ . then ( ( ) => {
776+ return job . moveToFailed ( new Error ( 'test error' ) , true ) ;
777+ } )
778+ . then ( ( ) => {
779+ return scripts . moveToActive ( queue ) ;
780+ } )
781+ . then ( ( ) => {
782+ return job . moveToFailed ( new Error ( 'test error' ) , true ) . then ( ( ) => {
783+ return job . isFailed ( ) . then ( isFailed => {
784+ expect ( isFailed ) . to . be ( true ) ;
785+ expect ( job . stacktrace ) . not . be ( null ) ;
786+ expect ( job . stacktrace . length ) . to . be ( stackTraceLimit ) ;
787+ } ) ;
788788 } ) ;
789- }
790- ) ;
789+ } ) ;
790+ } ) ;
791791 } ) ;
792792 } ) ;
793793
@@ -914,8 +914,8 @@ describe('Job', () => {
914914 } )
915915 . then ( state => {
916916 expect ( state ) . to . be ( 'completed' ) ;
917- return client . zrem ( queue . toKey ( 'completed' ) , job . id ) . then ( ( ) => {
918- return client . lpush ( queue . toKey ( 'active' ) , job . id )
917+ return client . zrem ( queue . toKey ( 'completed' ) , job . id ) . then ( ( ) => {
918+ return client . lpush ( queue . toKey ( 'active' ) , job . id ) ;
919919 } ) ;
920920 } )
921921 . then ( ( ) => {
@@ -930,8 +930,8 @@ describe('Job', () => {
930930 } )
931931 . then ( state => {
932932 expect ( state ) . to . be ( 'delayed' ) ;
933- return client . zrem ( queue . toKey ( 'delayed' ) , job . id ) . then ( ( ) => {
934- return client . lpush ( queue . toKey ( 'active' ) , job . id )
933+ return client . zrem ( queue . toKey ( 'delayed' ) , job . id ) . then ( ( ) => {
934+ return client . lpush ( queue . toKey ( 'active' ) , job . id ) ;
935935 } ) ;
936936 } )
937937 . then ( ( ) => {
0 commit comments