You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
320 B
14 lines
320 B
async function assertRevert (promise) {
|
|
try {
|
|
await promise;
|
|
} catch (error) {
|
|
const revertFound = error.message.search('revert') >= 0;
|
|
assert(revertFound, `Expected "revert", got ${error} instead`);
|
|
return;
|
|
}
|
|
assert.fail('Expected revert not received');
|
|
}
|
|
|
|
module.exports = {
|
|
assertRevert,
|
|
};
|
|
|