diff --git a/src/expectRevert.js b/src/expectRevert.js index b1bd9ce..7325de9 100644 --- a/src/expectRevert.js +++ b/src/expectRevert.js @@ -8,7 +8,8 @@ async function expectException (promise, expectedError) { await promise; } catch (error) { if (error.message.indexOf(expectedError) === -1) { - throw Error(`Wrong failure type, expected '${expectedError}' and got '${error.message}'`); + const actualError = error.message.replace('Returned error: VM Exception while processing transaction: ', ''); + assert.fail(`Wrong failure type, expected '${expectedError}' and got '${actualError}'`); } return; }