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,5 +1,11 @@
|
||||
const MathMock = artifacts.require('MathMock');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
contract('Math', function () {
|
||||
const min = 1234;
|
||||
const max = 5678;
|
||||
@ -11,24 +17,24 @@ contract('Math', function () {
|
||||
describe('max', function () {
|
||||
it('is correctly detected in first argument position', async function () {
|
||||
const result = await this.math.max(max, min);
|
||||
assert.equal(result, max);
|
||||
result.should.be.bignumber.equal(max);
|
||||
});
|
||||
|
||||
it('is correctly detected in second argument position', async function () {
|
||||
const result = await this.math.max(min, max);
|
||||
assert.equal(result, max);
|
||||
result.should.be.bignumber.equal(max);
|
||||
});
|
||||
});
|
||||
|
||||
describe('min', function () {
|
||||
it('is correctly detected in first argument position', async function () {
|
||||
const result = await this.math.min(min, max);
|
||||
assert.equal(result, min);
|
||||
result.should.be.bignumber.equal(min);
|
||||
});
|
||||
|
||||
it('is correctly detected in second argument position', async function () {
|
||||
const result = await this.math.min(max, min);
|
||||
assert.equal(result, min);
|
||||
result.should.be.bignumber.equal(min);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user