Replace chai.should with chai.expect (#1780)

* changed exxpect to expect wherever applicable

* Merged with latest branch

* Updated merkleTree helper to latest master branch

* Made linting fixes

* Fix for test build

* updated for Coverage

* Updated Address.test.js

* Undo package-lock changes.
This commit is contained in:
Yohann Pereira
2019-06-24 16:40:05 -04:00
committed by Francisco Giordano
parent 852e11c2db
commit 489d2e85f1
57 changed files with 564 additions and 453 deletions

View File

@ -1,6 +1,8 @@
const { balance, constants, ether, expectEvent, expectRevert } = require('openzeppelin-test-helpers');
const { ZERO_ADDRESS } = constants;
const { expect } = require('chai');
const RefundEscrow = artifacts.require('RefundEscrow');
contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee2]) {
@ -20,14 +22,14 @@ contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee
context('active state', function () {
it('has beneficiary and state', async function () {
(await this.escrow.beneficiary()).should.be.equal(beneficiary);
(await this.escrow.state()).should.be.bignumber.equal('0');
expect(await this.escrow.beneficiary()).to.equal(beneficiary);
expect(await this.escrow.state()).to.be.bignumber.equal('0');
});
it('accepts deposits', async function () {
await this.escrow.deposit(refundee1, { from: primary, value: amount });
(await this.escrow.depositsOf(refundee1)).should.be.bignumber.equal(amount);
expect(await this.escrow.depositsOf(refundee1)).to.be.bignumber.equal(amount);
});
it('does not refund refundees', async function () {
@ -76,7 +78,7 @@ contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee
it('allows beneficiary withdrawal', async function () {
const balanceTracker = await balance.tracker(beneficiary);
await this.escrow.beneficiaryWithdraw();
(await balanceTracker.delta()).should.be.bignumber.equal(amount.muln(refundees.length));
expect(await balanceTracker.delta()).to.be.bignumber.equal(amount.muln(refundees.length));
});
it('prevents entering the refund state', async function () {
@ -118,7 +120,7 @@ contract('RefundEscrow', function ([_, primary, beneficiary, refundee1, refundee
for (const refundee of [refundee1, refundee2]) {
const balanceTracker = await balance.tracker(refundee);
await this.escrow.withdraw(refundee, { from: primary });
(await balanceTracker.delta()).should.be.bignumber.equal(amount);
expect(await balanceTracker.delta()).to.be.bignumber.equal(amount);
}
});