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:
Nicolás Venturo
2018-08-10 19:03:04 -03:00
committed by Francisco Giordano
parent a2e7103869
commit ac91af9a6a
41 changed files with 396 additions and 297 deletions

View File

@ -3,6 +3,9 @@ const { sha3, bufferToHex } = require('ethereumjs-util');
const MerkleProofWrapper = artifacts.require('MerkleProofWrapper');
require('chai')
.should();
contract('MerkleProof', function () {
let merkleProof;
@ -22,7 +25,7 @@ contract('MerkleProof', function () {
const leaf = bufferToHex(sha3(elements[0]));
const result = await merkleProof.verifyProof(proof, root, leaf);
assert.isOk(result, 'verifyProof did not return true for a valid proof');
result.should.be.true;
});
it('should return false for an invalid Merkle proof', async function () {
@ -39,7 +42,7 @@ contract('MerkleProof', function () {
const badProof = badMerkleTree.getHexProof(badElements[0]);
const result = await merkleProof.verifyProof(badProof, correctRoot, correctLeaf);
assert.isNotOk(result, 'verifyProof did not return false for an invalid proof');
result.should.be.false;
});
it('should return false for a Merkle proof of invalid length', async function () {
@ -54,7 +57,7 @@ contract('MerkleProof', function () {
const leaf = bufferToHex(sha3(elements[0]));
const result = await merkleProof.verifyProof(badProof, root, leaf);
assert.isNotOk(result, 'verifyProof did not return false for proof of invalid length');
result.should.be.false;
});
});
});