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,5 +1,7 @@
const { balance, ether, expectEvent, expectRevert } = require('openzeppelin-test-helpers');
const { expect } = require('chai');
function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
const amount = ether('42');
@ -8,9 +10,9 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
it('can accept a single deposit', async function () {
await this.escrow.deposit(payee1, { from: primary, value: amount });
(await balance.current(this.escrow.address)).should.be.bignumber.equal(amount);
expect(await balance.current(this.escrow.address)).to.be.bignumber.equal(amount);
(await this.escrow.depositsOf(payee1)).should.be.bignumber.equal(amount);
expect(await this.escrow.depositsOf(payee1)).to.be.bignumber.equal(amount);
});
it('can accept an empty deposit', async function () {
@ -35,20 +37,20 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
await this.escrow.deposit(payee1, { from: primary, value: amount });
await this.escrow.deposit(payee1, { from: primary, value: amount.muln(2) });
(await balance.current(this.escrow.address)).should.be.bignumber.equal(amount.muln(3));
expect(await balance.current(this.escrow.address)).to.be.bignumber.equal(amount.muln(3));
(await this.escrow.depositsOf(payee1)).should.be.bignumber.equal(amount.muln(3));
expect(await this.escrow.depositsOf(payee1)).to.be.bignumber.equal(amount.muln(3));
});
it('can track deposits to multiple accounts', async function () {
await this.escrow.deposit(payee1, { from: primary, value: amount });
await this.escrow.deposit(payee2, { from: primary, value: amount.muln(2) });
(await balance.current(this.escrow.address)).should.be.bignumber.equal(amount.muln(3));
expect(await balance.current(this.escrow.address)).to.be.bignumber.equal(amount.muln(3));
(await this.escrow.depositsOf(payee1)).should.be.bignumber.equal(amount);
expect(await this.escrow.depositsOf(payee1)).to.be.bignumber.equal(amount);
(await this.escrow.depositsOf(payee2)).should.be.bignumber.equal(amount.muln(2));
expect(await this.escrow.depositsOf(payee2)).to.be.bignumber.equal(amount.muln(2));
});
});
@ -59,10 +61,10 @@ function shouldBehaveLikeEscrow (primary, [payee1, payee2]) {
await this.escrow.deposit(payee1, { from: primary, value: amount });
await this.escrow.withdraw(payee1, { from: primary });
(await balanceTracker.delta()).should.be.bignumber.equal(amount);
expect(await balanceTracker.delta()).to.be.bignumber.equal(amount);
(await balance.current(this.escrow.address)).should.be.bignumber.equal('0');
(await this.escrow.depositsOf(payee1)).should.be.bignumber.equal('0');
expect(await balance.current(this.escrow.address)).to.be.bignumber.equal('0');
expect(await this.escrow.depositsOf(payee1)).to.be.bignumber.equal('0');
});
it('can do an empty withdrawal', async function () {