Files
openzeppelin-contracts/test/helpers/assertRevert.js
Nicolás Venturo ac91af9a6a Replace all asserts with chai.should (#1183)
* Moving towards chai.should.

* Fixed failing tests.

* Fixed linter errors.

* Revert package-lock.json changes.

* Fixed failing tests.

* s/eq/equal

* Addressed review comment
2018-08-10 19:03:04 -03:00

17 lines
323 B
JavaScript

const should = require('chai')
.should();
async function assertRevert (promise) {
try {
await promise;
} catch (error) {
error.message.should.include('revert', `Expected "revert", got ${error} instead`);
return;
}
should.fail('Expected revert not received');
}
module.exports = {
assertRevert,
};