File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,13 +139,15 @@ describe('util', () => {
139139 } ) ;
140140
141141 it ( 'should timeout' , ( ) => {
142+ let error ;
142143 try {
143144 util . safelyExecuteWithTimeout ( ( ) => {
144145 return new Promise ( ( res ) => setTimeout ( res , 800 ) ) ;
145146 } ) ;
146147 } catch ( e ) {
147- expect ( e . message ) . toContain ( 'timeout' ) ;
148+ error = e ;
148149 }
150+ expect ( error ) . toBeUndefined ( ) ;
149151 } ) ;
150152 } ) ;
151153
@@ -679,11 +681,13 @@ describe('util', () => {
679681 it ( 'should query and reject if error' , async ( ) => {
680682 const ethQuery = new EthQuery ( PROVIDER ) ;
681683 mockFlags . gasPrice = 'Uh oh' ;
684+ let errorMessage ;
682685 try {
683686 await util . query ( ethQuery , 'gasPrice' , [ ] ) ;
684687 } catch ( error ) {
685- expect ( error . message ) . toContain ( 'Uh oh' ) ;
688+ errorMessage = error . message ;
686689 }
690+ expect ( errorMessage ) . toContain ( 'Uh oh' ) ;
687691 } ) ;
688692 } ) ;
689693} ) ;
You can’t perform that action at this time.
0 commit comments