Skip to content

Commit

Permalink
improve expectRevert output
Browse files Browse the repository at this point in the history
  • Loading branch information
dotrungkien committed Jun 26, 2019
1 parent a4789e0 commit 1925ada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/expectRevert.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1925ada

Please sign in to comment.