Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Changing chai.should to chai.expect - Issue #1687 #1723

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions test/access/Roles.test.js
@@ -1,3 +1,4 @@
const { expect } = require('chai');
const { shouldFail, constants } = require('openzeppelin-test-helpers');
const { ZERO_ADDRESS } = constants;

Expand All @@ -14,16 +15,16 @@ contract('Roles', function ([_, authorized, otherAuthorized, other]) {

context('initially', function () {
it('doesn\'t pre-assign roles', async function () {
(await this.roles.has(authorized)).should.equal(false);
(await this.roles.has(otherAuthorized)).should.equal(false);
(await this.roles.has(other)).should.equal(false);
expect( await this.roles.has(authorized)).to.equal(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter (npm run lint:js) is failing because of this extra space, I think we can remove it without hindering readability.

Suggested change
expect( await this.roles.has(authorized)).to.equal(false);
expect(await this.roles.has(authorized)).to.equal(false);

expect( await this.roles.has(otherAuthorized)).to.equal(false);
expect( await this.roles.has(other)).to.equal(false);
});

describe('adding roles', function () {
it('adds roles to a single account', async function () {
await this.roles.add(authorized);
(await this.roles.has(authorized)).should.equal(true);
(await this.roles.has(other)).should.equal(false);
expect( await this.roles.has(authorized)).to.equal(true);
expect( await this.roles.has(other)).to.equal(false);
});

it('reverts when adding roles to an already assigned account', async function () {
Expand All @@ -46,8 +47,8 @@ contract('Roles', function ([_, authorized, otherAuthorized, other]) {
describe('removing roles', function () {
it('removes a single role', async function () {
await this.roles.remove(authorized);
(await this.roles.has(authorized)).should.equal(false);
(await this.roles.has(otherAuthorized)).should.equal(true);
expect( await this.roles.has(authorized)).to.equal(false);
expect( await this.roles.has(otherAuthorized)).to.equal(true);
});

it('reverts when removing unassigned roles', async function () {
Expand Down