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
This commit is contained in:
committed by
Francisco Giordano
parent
a2e7103869
commit
ac91af9a6a
@ -1,12 +1,14 @@
|
||||
const should = require('chai')
|
||||
.should();
|
||||
|
||||
async function assertRevert (promise) {
|
||||
try {
|
||||
await promise;
|
||||
} catch (error) {
|
||||
const revertFound = error.message.search('revert') >= 0;
|
||||
assert(revertFound, `Expected "revert", got ${error} instead`);
|
||||
error.message.should.include('revert', `Expected "revert", got ${error} instead`);
|
||||
return;
|
||||
}
|
||||
assert.fail('Expected revert not received');
|
||||
should.fail('Expected revert not received');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user