@@ -225,11 +225,11 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
225225 value : opts . accounts
226226 }
227227 testCallback ( undefined , accts )
228-
228+ const filename = testObject . filename
229229 const resp : TestResultInterface = {
230230 type : 'contract' ,
231231 value : testName ,
232- filename : testObject . filename
232+ filename
233233 }
234234 testCallback ( undefined , resp )
235235 async . eachOfLimit ( runList , 1 , async function ( func , index , next ) {
@@ -253,7 +253,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
253253 const resp : TestResultInterface = {
254254 type : 'testPass' ,
255255 value : changeCase . sentenceCase ( func . name ) ,
256- filename : testObject . filename ,
256+ filename,
257257 time : time ,
258258 context : testName ,
259259 provider,
@@ -267,7 +267,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
267267 const resp : TestResultInterface = {
268268 type : 'testFailure' ,
269269 value : changeCase . sentenceCase ( func . name ) ,
270- filename : testObject . filename ,
270+ filename,
271271 time : time ,
272272 errMsg : 'function returned false' ,
273273 context : testName ,
@@ -279,6 +279,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
279279 failureNum += 1
280280 timePassed += time
281281 }
282+ return next ( )
282283 } else {
283284 if ( func . signature ) {
284285 sender = getOverriddenSender ( contractDetails . userdoc , func . signature , contractDetails . evm . methodIdentifiers )
@@ -308,6 +309,23 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
308309 const time : number = ( Date . now ( ) - startTime ) / 1000.0
309310 const assertionEventHashes = assertionEvents . map ( e => keccak256 ( toUtf8Bytes ( e . name + '(' + e . params . join ( ) + ')' ) ) )
310311 let testPassed = false
312+ if ( receipt . status === 0 ) {
313+ const resp : TestResultInterface = {
314+ type : 'testFailure' ,
315+ value : changeCase . sentenceCase ( func . name ) ,
316+ filename,
317+ time : time ,
318+ errMsg : `Transaction with hash "${ debugTxHash } " has been reverted by the EVM.` ,
319+ context : testName ,
320+ provider,
321+ debugTxHash
322+ }
323+ if ( hhLogs && hhLogs . length ) resp . hhLogs = hhLogs
324+ testCallback ( undefined , resp )
325+ failureNum += 1
326+ timePassed += time
327+ return next ( )
328+ }
311329 for ( const i in receipt . logs ) {
312330 let events = receipt . logs [ i ]
313331 if ( ! Array . isArray ( events ) ) events = [ events ]
@@ -323,10 +341,11 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
323341 testEvent [ 4 ] = 'true'
324342 }
325343 const location = getAssertMethodLocation ( fileAST , testName , func . name , assertMethod )
344+
326345 const resp : TestResultInterface = {
327346 type : 'testFailure' ,
328347 value : changeCase . sentenceCase ( func . name ) ,
329- filename : testObject . filename ,
348+ filename,
330349 time : time ,
331350 errMsg : testEvent [ 1 ] ,
332351 context : testName ,
@@ -352,7 +371,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
352371 const resp : TestResultInterface = {
353372 type : 'testPass' ,
354373 value : changeCase . sentenceCase ( func . name ) ,
355- filename : testObject . filename ,
374+ filename,
356375 time : time ,
357376 context : testName ,
358377 provider,
@@ -366,7 +385,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
366385 const resp : TestResultInterface = {
367386 type : 'logOnly' ,
368387 value : changeCase . sentenceCase ( func . name ) ,
369- filename : testObject . filename ,
388+ filename,
370389 time : time ,
371390 context : testName ,
372391 hhLogs
@@ -390,7 +409,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
390409 const resp : TestResultInterface = {
391410 type : 'testFailure' ,
392411 value : changeCase . sentenceCase ( func . name ) ,
393- filename : testObject . filename ,
412+ filename,
394413 time : time ,
395414 errMsg,
396415 context : testName ,
0 commit comments