From ea1cb5c54e0865dcc957c7ec7b533fb2d7440532 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Mon, 15 Jan 2018 16:58:00 -0300 Subject: [PATCH] add missing awaits in tests --- test/Bounty.test.js | 4 ++-- test/RBAC.test.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Bounty.test.js b/test/Bounty.test.js index 4ea34714f..8d657474c 100644 --- a/test/Bounty.test.js +++ b/test/Bounty.test.js @@ -74,7 +74,7 @@ contract('Bounty', function (accounts) { web3.eth.getBalance(bounty.address).toNumber()); } }; - bounty.createTarget({ from: researcher }); + await bounty.createTarget({ from: researcher }); await awaitEvent(event, watcher); }); }); @@ -104,7 +104,7 @@ contract('Bounty', function (accounts) { assert.equal(0, web3.eth.getBalance(bounty.address).toNumber()); }; - bounty.createTarget({ from: researcher }); + await bounty.createTarget({ from: researcher }); await awaitEvent(event, watcher); }); }); diff --git a/test/RBAC.test.js b/test/RBAC.test.js index 50a36bece..9fc2ee7f1 100644 --- a/test/RBAC.test.js +++ b/test/RBAC.test.js @@ -45,17 +45,17 @@ contract('RBAC', function (accounts) { .should.be.fulfilled; }); it('does not allow admins to call #nobodyCanDoThis', async () => { - expectThrow( + await expectThrow( mock.nobodyCanDoThis({ from: admin }) ); }); it('does not allow advisors to call #nobodyCanDoThis', async () => { - expectThrow( + await expectThrow( mock.nobodyCanDoThis({ from: advisors[0] }) ); }); it('does not allow anyone to call #nobodyCanDoThis', async () => { - expectThrow( + await expectThrow( mock.nobodyCanDoThis({ from: anyone }) ); }); @@ -69,14 +69,14 @@ contract('RBAC', function (accounts) { }); it('announces a RoleAdded event on addRole', async () => { - expectEvent.inTransaction( + await expectEvent.inTransaction( mock.adminAddRole(futureAdvisor, ROLE_ADVISOR, { from: admin }), 'RoleAdded' ); }); it('announces a RoleRemoved event on removeRole', async () => { - expectEvent.inTransaction( + await expectEvent.inTransaction( mock.adminRemoveRole(futureAdvisor, ROLE_ADVISOR, { from: admin }), 'RoleRemoved' ); @@ -85,12 +85,12 @@ contract('RBAC', function (accounts) { context('in adversarial conditions', () => { it('does not allow an advisor to remove another advisor', async () => { - expectThrow( + await expectThrow( mock.removeAdvisor(advisors[1], { from: advisors[0] }) ); }); it('does not allow "anyone" to remove an advisor', async () => { - expectThrow( + await expectThrow( mock.removeAdvisor(advisors[0], { from: anyone }) ); });