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:
@ -20,7 +20,7 @@ function shouldBehaveLikeMintableToken (owner, minter, [anyone]) {
|
||||
describe('minting finished', function () {
|
||||
describe('when the token minting is not finished', function () {
|
||||
it('returns false', async function () {
|
||||
(await this.token.mintingFinished()).should.be.false;
|
||||
(await this.token.mintingFinished()).should.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
@ -30,7 +30,7 @@ function shouldBehaveLikeMintableToken (owner, minter, [anyone]) {
|
||||
});
|
||||
|
||||
it('returns true', async function () {
|
||||
(await this.token.mintingFinished()).should.be.true;
|
||||
(await this.token.mintingFinished()).should.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -43,7 +43,7 @@ function shouldBehaveLikeMintableToken (owner, minter, [anyone]) {
|
||||
it('finishes token minting', async function () {
|
||||
await this.token.finishMinting({ from });
|
||||
|
||||
(await this.token.mintingFinished()).should.be.true;
|
||||
(await this.token.mintingFinished()).should.equal(true);
|
||||
});
|
||||
|
||||
it('emits a mint finished event', async function () {
|
||||
|
||||
@ -13,7 +13,7 @@ contract('PausableToken', function ([_, owner, recipient, anotherAccount]) {
|
||||
describe('when the token is unpaused', function () {
|
||||
it('pauses the token', async function () {
|
||||
await this.token.pause({ from });
|
||||
(await this.token.paused()).should.be.true;
|
||||
(await this.token.paused()).should.equal(true);
|
||||
});
|
||||
|
||||
it('emits a Pause event', async function () {
|
||||
@ -55,7 +55,7 @@ contract('PausableToken', function ([_, owner, recipient, anotherAccount]) {
|
||||
|
||||
it('unpauses the token', async function () {
|
||||
await this.token.unpause({ from });
|
||||
(await this.token.paused()).should.be.false;
|
||||
(await this.token.paused()).should.equal(false);
|
||||
});
|
||||
|
||||
it('emits an Unpause event', async function () {
|
||||
@ -87,18 +87,18 @@ contract('PausableToken', function ([_, owner, recipient, anotherAccount]) {
|
||||
|
||||
describe('paused', function () {
|
||||
it('is not paused by default', async function () {
|
||||
(await this.token.paused({ from })).should.be.false;
|
||||
(await this.token.paused({ from })).should.equal(false);
|
||||
});
|
||||
|
||||
it('is paused after being paused', async function () {
|
||||
await this.token.pause({ from });
|
||||
(await this.token.paused({ from })).should.be.true;
|
||||
(await this.token.paused({ from })).should.equal(true);
|
||||
});
|
||||
|
||||
it('is not paused after being paused and then unpaused', async function () {
|
||||
await this.token.pause({ from });
|
||||
await this.token.unpause({ from });
|
||||
(await this.token.paused()).should.be.false;
|
||||
(await this.token.paused()).should.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -6,10 +6,10 @@ function shouldBehaveLikeRBACMintableToken (owner, [anyone]) {
|
||||
describe('handle roles', function () {
|
||||
it('owner can add and remove a minter role', async function () {
|
||||
await this.token.addMinter(anyone, { from: owner });
|
||||
(await this.token.hasRole(anyone, ROLE_MINTER)).should.be.true;
|
||||
(await this.token.hasRole(anyone, ROLE_MINTER)).should.equal(true);
|
||||
|
||||
await this.token.removeMinter(anyone, { from: owner });
|
||||
(await this.token.hasRole(anyone, ROLE_MINTER)).should.be.false;
|
||||
(await this.token.hasRole(anyone, ROLE_MINTER)).should.equal(false);
|
||||
});
|
||||
|
||||
it('anyone can\'t add or remove a minter role', async function () {
|
||||
|
||||
@ -439,7 +439,7 @@ function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
it('approves the operator', async function () {
|
||||
await this.token.setApprovalForAll(operator, true, { from: sender });
|
||||
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.be.true;
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.equal(true);
|
||||
});
|
||||
|
||||
it('emits an approval event', async function () {
|
||||
@ -449,7 +449,7 @@ function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
logs[0].event.should.be.equal('ApprovalForAll');
|
||||
logs[0].args._owner.should.be.equal(sender);
|
||||
logs[0].args._operator.should.be.equal(operator);
|
||||
logs[0].args._approved.should.be.true;
|
||||
logs[0].args._approved.should.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
@ -461,7 +461,7 @@ function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
it('approves the operator', async function () {
|
||||
await this.token.setApprovalForAll(operator, true, { from: sender });
|
||||
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.be.true;
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.equal(true);
|
||||
});
|
||||
|
||||
it('emits an approval event', async function () {
|
||||
@ -471,13 +471,13 @@ function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
logs[0].event.should.be.equal('ApprovalForAll');
|
||||
logs[0].args._owner.should.be.equal(sender);
|
||||
logs[0].args._operator.should.be.equal(operator);
|
||||
logs[0].args._approved.should.be.true;
|
||||
logs[0].args._approved.should.equal(true);
|
||||
});
|
||||
|
||||
it('can unset the operator approval', async function () {
|
||||
await this.token.setApprovalForAll(operator, false, { from: sender });
|
||||
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.be.false;
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
@ -489,7 +489,7 @@ function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
it('keeps the approval to the given address', async function () {
|
||||
await this.token.setApprovalForAll(operator, true, { from: sender });
|
||||
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.be.true;
|
||||
(await this.token.isApprovedForAll(sender, operator)).should.equal(true);
|
||||
});
|
||||
|
||||
it('emits an approval event', async function () {
|
||||
@ -499,7 +499,7 @@ function shouldBehaveLikeERC721BasicToken (accounts) {
|
||||
logs[0].event.should.be.equal('ApprovalForAll');
|
||||
logs[0].args._owner.should.be.equal(sender);
|
||||
logs[0].args._operator.should.be.equal(operator);
|
||||
logs[0].args._approved.should.be.true;
|
||||
logs[0].args._approved.should.equal(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -126,7 +126,7 @@ contract('ERC721Token', function (accounts) {
|
||||
it('can burn token with metadata', async function () {
|
||||
await this.token.setTokenURI(firstTokenId, sampleUri);
|
||||
await this.token.burn(firstTokenId);
|
||||
(await this.token.exists(firstTokenId)).should.be.false;
|
||||
(await this.token.exists(firstTokenId)).should.equal(false);
|
||||
});
|
||||
|
||||
it('returns empty metadata for token', async function () {
|
||||
|
||||
Reference in New Issue
Block a user