From ccfd370b893c1fc273b2b553fe5cdd52e02eef3a Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 2 Jun 2020 17:00:56 -0300 Subject: [PATCH] Update Test Helpers to 0.5.6 (#2261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update test-helpers to 0.5.6-rc.0 * remove comment that no longer applies * fix uses of expectEvent.notEmitted * remove mocha only * update to final version * Update test/token/ERC777/ERC777.test.js Co-authored-by: Nicolás Venturo Co-authored-by: Nicolás Venturo --- package-lock.json | 22 +++++++++++++++++----- package.json | 2 +- test/access/AccessControl.test.js | 10 +++++----- test/token/ERC777/ERC777.test.js | 4 ++-- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 498fbafcb..c77a0febd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2053,13 +2053,13 @@ } }, "@openzeppelin/test-helpers": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/@openzeppelin/test-helpers/-/test-helpers-0.5.5.tgz", - "integrity": "sha512-jTSCQojQ0Q7FBMN3Me7o0OIVuRnfHRR9TcE+ZlfbSfdqrHkFLwSfeDHSNWtQGlF1xPQR5r3iRI0ccsCrN+JblA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@openzeppelin/test-helpers/-/test-helpers-0.5.6.tgz", + "integrity": "sha512-8U4sR4ed4cFmc6UKj7akUxZzQJKU9P3p/3RbF+urQuRLLhBaB8zSya1m9VB7/anYEZnBmTDk8LuVgAmYaCPs9A==", "dev": true, "requires": { "@openzeppelin/contract-loader": "^0.4.0", - "@truffle/contract": "^4.0.35", + "@truffle/contract": "^4.0.35 <4.2.2", "ansi-colors": "^3.2.3", "chai": "^4.2.0", "chai-bn": "^0.2.1", @@ -4429,7 +4429,8 @@ "acorn": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", - "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "dev": true }, "acorn-jsx": { "version": "5.1.0", @@ -8893,6 +8894,11 @@ "negotiator": "0.6.2" } }, + "acorn": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + }, "acorn-jsx": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", @@ -21707,6 +21713,7 @@ "@webassemblyjs/helper-module-context": "1.8.5", "@webassemblyjs/wasm-edit": "1.8.5", "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.2.1", "ajv": "^6.10.2", "ajv-keywords": "^3.4.1", "chrome-trace-event": "^1.0.2", @@ -21727,6 +21734,11 @@ "webpack-sources": "^1.4.1" }, "dependencies": { + "acorn": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", + "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + }, "cacache": { "version": "12.0.3", "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", diff --git a/package.json b/package.json index c02d9f95e..403499c12 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@openzeppelin/gsn-helpers": "^0.2.3", "@openzeppelin/gsn-provider": "^0.1.10", "@openzeppelin/test-environment": "^0.1.4", - "@openzeppelin/test-helpers": "^0.5.5", + "@openzeppelin/test-helpers": "^0.5.6", "chai": "^4.2.0", "eslint": "^6.5.1", "eslint-config-standard": "^14.1.1", diff --git a/test/access/AccessControl.test.js b/test/access/AccessControl.test.js index 40dd5980d..c7a30d32b 100644 --- a/test/access/AccessControl.test.js +++ b/test/access/AccessControl.test.js @@ -49,7 +49,7 @@ describe('AccessControl', function () { it('accounts can be granted a role multiple times', async function () { await this.accessControl.grantRole(ROLE, authorized, { from: admin }); const receipt = await this.accessControl.grantRole(ROLE, authorized, { from: admin }); - await expectEvent.not.inTransaction(receipt.tx, AccessControlMock, 'RoleGranted'); + expectEvent.notEmitted(receipt, 'RoleGranted'); }); }); @@ -58,7 +58,7 @@ describe('AccessControl', function () { expect(await this.accessControl.hasRole(ROLE, authorized)).to.equal(false); const receipt = await this.accessControl.revokeRole(ROLE, authorized, { from: admin }); - await expectEvent.not.inTransaction(receipt.tx, AccessControlMock, 'RoleRevoked'); + expectEvent.notEmitted(receipt, 'RoleRevoked'); }); context('with granted role', function () { @@ -84,7 +84,7 @@ describe('AccessControl', function () { await this.accessControl.revokeRole(ROLE, authorized, { from: admin }); const receipt = await this.accessControl.revokeRole(ROLE, authorized, { from: admin }); - await expectEvent.not.inTransaction(receipt.tx, AccessControlMock, 'RoleRevoked'); + expectEvent.notEmitted(receipt, 'RoleRevoked'); }); }); }); @@ -92,7 +92,7 @@ describe('AccessControl', function () { describe('renouncing', function () { it('roles that are not had can be renounced', async function () { const receipt = await this.accessControl.renounceRole(ROLE, authorized, { from: authorized }); - await expectEvent.not.inTransaction(receipt.tx, AccessControlMock, 'RoleRevoked'); + expectEvent.notEmitted(receipt, 'RoleRevoked'); }); context('with granted role', function () { @@ -118,7 +118,7 @@ describe('AccessControl', function () { await this.accessControl.renounceRole(ROLE, authorized, { from: authorized }); const receipt = await this.accessControl.renounceRole(ROLE, authorized, { from: authorized }); - await expectEvent.not.inTransaction(receipt.tx, AccessControlMock, 'RoleRevoked'); + expectEvent.notEmitted(receipt, 'RoleRevoked'); }); }); }); diff --git a/test/token/ERC777/ERC777.test.js b/test/token/ERC777/ERC777.test.js index ffd01a214..0822bc988 100644 --- a/test/token/ERC777/ERC777.test.js +++ b/test/token/ERC777/ERC777.test.js @@ -60,8 +60,8 @@ describe('ERC777', function () { }); }); - it.skip('does not emit AuthorizedOperator events for default operators', async function () { - expectEvent.not.inConstructor(this.token, 'AuthorizedOperator'); // This helper needs to be implemented + it('does not emit AuthorizedOperator events for default operators', async function () { + await expectEvent.notEmitted.inConstruction(this.token, 'AuthorizedOperator'); }); describe('basic information', function () {