From 565a3af10211a16a4ab8fc2033be4ddb638baf7e Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 22 Jun 2018 13:19:32 -0400 Subject: [PATCH] stop provider when reseting providers --- lib/tests/test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tests/test.js b/lib/tests/test.js index 4ef1421fd..37ca1e359 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -44,6 +44,9 @@ class Test { } initWeb3Provider(callback) { + if (this.provider) { + this.provider.stop(); + } if (this.simOptions.host) { let {host, port, type, protocol, accounts} = this.simOptions; if (!protocol) { @@ -78,7 +81,9 @@ class Test { return {balance: account.hexBalance, secretKey: account.privateKey}; }); } - this.sim = getSimulator(); + if (!this.sim) { + this.sim = getSimulator(); + } this.web3.setProvider(this.sim.provider(this.simOptions)); callback(); }