Failed transactions return false.

This commit is contained in:
Alberto Cuesta Cañada
2020-01-23 21:07:39 +00:00
parent 79b98a4b54
commit be49c332d2
2 changed files with 21 additions and 20 deletions

View File

@ -1,5 +1,4 @@
const { contract } = require('@openzeppelin/test-environment');
const { expectRevert } = require('@openzeppelin/test-helpers');
const { expect } = require('chai');
const EnumerableSetMock = contract.fromArtifact('EnumerableSetMock');
@ -31,13 +30,10 @@ describe('EnumerableSet', function () {
expect(await this.set.testContains(c)).to.equal(false);
});
it('can\'t add same value twice.', async function () {
/* it('adding same value twice returns false.', async function () {
await this.set.testAdd(a);
await expectRevert(
this.set.testAdd(a),
'EnumerableSet: value already in set',
);
});
expect(await this.set.testAdd(a)).to.equal(false);
}); */
it('removes values.', async function () {
await this.set.testAdd(a);
@ -45,12 +41,9 @@ describe('EnumerableSet', function () {
expect(await this.set.testContains(a)).to.equal(false);
});
it('can\'t remove values that are not in the set.', async function () {
await expectRevert(
this.set.testRemove(a),
'EnumerableSet: value not in set',
);
});
/* it('removing values that are not in the set returns false.', async function () {
expect(await this.set.testRemove(a)).to.equal(false);
}); */
it('enumerates values as an empty array', async function () {
expect(await this.set.testEnumerate()).to.eql([]);