File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,13 @@ describe('Bolt V3 API', () => {
92
92
session . run ( 'MATCH (n:Node) SET n.prop = $newValue' , { newValue : 2 } , { timeout : 1 } )
93
93
. then ( ( ) => done . fail ( 'Failure expected' ) )
94
94
. catch ( error => {
95
- expect ( error . code . indexOf ( 'TransientError' ) ) . toBeGreaterThan ( 0 ) ;
96
- expect ( error . message . indexOf ( 'transaction has been terminated' ) ) . toBeGreaterThan ( 0 ) ;
95
+ const hasExpectedCode = error . code . indexOf ( 'TransientError' ) !== - 1 ;
96
+ const hasExpectedMessage = error . message . indexOf ( 'transaction has been terminated' ) !== - 1 ;
97
+ if ( ! hasExpectedCode || ! hasExpectedMessage ) {
98
+ console . log ( `Unexpected error with code ${ error . code } ` , error ) ;
99
+ }
100
+ expect ( hasExpectedCode ) . toBeTruthy ( ) ;
101
+ expect ( hasExpectedMessage ) . toBeTruthy ( ) ;
97
102
98
103
tx . rollback ( )
99
104
. then ( ( ) => otherSession . close ( ) )
You can’t perform that action at this time.
0 commit comments