Minor test style improvements (#1219)
* Changed .eq to .equal * Changed equal(bool) to .to.be.bool * Changed be.bool to equal(bool), disallowed unused expressions.
This commit is contained in:
@ -9,7 +9,7 @@ const { ethGetBalance } = require('../helpers/web3');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
const should = require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
@ -40,8 +40,8 @@ contract('SampleCrowdsale', function ([_, owner, wallet, investor]) {
|
||||
});
|
||||
|
||||
it('should create crowdsale with correct parameters', async function () {
|
||||
this.crowdsale.should.exist;
|
||||
this.token.should.exist;
|
||||
should.exist(this.crowdsale);
|
||||
should.exist(this.token);
|
||||
|
||||
(await this.crowdsale.openingTime()).should.be.bignumber.equal(this.openingTime);
|
||||
(await this.crowdsale.closingTime()).should.be.bignumber.equal(this.closingTime);
|
||||
|
||||
@ -17,11 +17,11 @@ contract('SimpleToken', function ([_, creator]) {
|
||||
});
|
||||
|
||||
it('has a name', async function () {
|
||||
(await token.name()).should.eq('SimpleToken');
|
||||
(await token.name()).should.equal('SimpleToken');
|
||||
});
|
||||
|
||||
it('has a symbol', async function () {
|
||||
(await token.symbol()).should.eq('SIM');
|
||||
(await token.symbol()).should.equal('SIM');
|
||||
});
|
||||
|
||||
it('has 18 decimals', async function () {
|
||||
@ -36,7 +36,7 @@ contract('SimpleToken', function ([_, creator]) {
|
||||
|
||||
const receipt = await web3.eth.getTransactionReceipt(token.transactionHash);
|
||||
const logs = decodeLogs(receipt.logs, SimpleToken, token.address);
|
||||
logs.length.should.eq(1);
|
||||
logs.length.should.equal(1);
|
||||
logs[0].event.should.equal('Transfer');
|
||||
logs[0].args.from.valueOf().should.equal(ZERO_ADDRESS);
|
||||
logs[0].args.to.valueOf().should.equal(creator);
|
||||
|
||||
Reference in New Issue
Block a user