diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-21 22:53:05 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-21 22:53:05 +0800 |
commit | eaabe1586374a25439c880ada348d87a5b3df740 (patch) | |
tree | 3de86c31d947b4e347d8219b57e6a54a679e2026 /packages/contracts/src/utils/assertions.ts | |
parent | 63b2ae743bd6cb4e8759659bca09e4bbdcf0cd63 (diff) | |
download | dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.tar dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.tar.gz dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.tar.bz2 dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.tar.lz dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.tar.xz dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.tar.zst dexon-sol-tools-eaabe1586374a25439c880ada348d87a5b3df740.zip |
Update core tests to actually check revert message
Diffstat (limited to 'packages/contracts/src/utils/assertions.ts')
-rw-r--r-- | packages/contracts/src/utils/assertions.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/assertions.ts b/packages/contracts/src/utils/assertions.ts index 615e648f3..29489e648 100644 --- a/packages/contracts/src/utils/assertions.ts +++ b/packages/contracts/src/utils/assertions.ts @@ -52,6 +52,18 @@ export function expectRevertOrAlwaysFailingTransactionAsync<T>(p: Promise<T>): P } /** + * Rejects if the given Promise does not reject with the given revert reason or "always + * failing transaction" error. + * @param p the Promise which is expected to reject + * @param reason a specific revert reason + * @returns a new Promise which will reject if the conditions are not met and + * otherwise resolve with no value. + */ +export function expectRevertReasonOrAlwaysFailingTransactionAsync<T>(p: Promise<T>, reason: string): PromiseLike<void> { + return _expectEitherErrorAsync(p, 'always failing transaction', reason); +} + +/** * Rejects if the given Promise does not reject with a "revert" or "Contract * call failed" error. * @param p the Promise which is expected to reject |