Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Fixed false positives in expectTransactionFailedAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
hysz committed Jun 5, 2019
1 parent b2cf701 commit dcd86f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/test-utils/src/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export async function expectTransactionFailedAsync(p: sendTransactionResult, rea
}
switch (nodeType) {
case NodeType.Ganache:
return expect(p).to.be.rejectedWith(reason);
const rejectionMessage = new RegExp(`^VM Exception while processing transaction: revert ${reason}$`);
return expect(p).to.be.rejectedWith(rejectionMessage);
case NodeType.Geth:
logUtils.warn(
'WARNING: Geth does not support revert reasons for sendTransaction. This test will pass if the transaction fails for any reason.',
Expand Down

0 comments on commit dcd86f1

Please sign in to comment.