Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
environment: allow exceptions to bubble up
Browse files Browse the repository at this point in the history
  - remove catch
  - add messages to assertions
  • Loading branch information
cds-amal committed Mar 9, 2022
1 parent 65ee2e8 commit a971288
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/environment/test/connectOrStartTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ describe("connectOrStart test network", async function () {
let connection;
try {
connection = await Develop.connectOrStart(ipcOptions, ganacheOptions);
assert.isTrue(connection.started, "A new server did not spin up");
assert.isFunction(connection.disconnect, "Disconnect is not a function");
} catch (error) {
console.log(error);
assert.fail("Develop.connectOrStart should not have thrown!");
assert.isTrue(connection.started, "A new Ganache server did not spin up");
assert.isFunction(connection.disconnect, "disconnect is not a function");
} finally {
if (connection) {
return connection.disconnect();
connection.disconnect();
}
}
});

it("connects to an established ganache instance", async function () {
it("connects to an established Ganache instance", async function () {
let connectionOneDisconnect, connectionTwoDisconnect;

try {
Expand All @@ -37,10 +34,10 @@ describe("connectOrStart test network", async function () {
//invoke the method again
const result = await Develop.connectOrStart(ipcOptions, ganacheOptions);
connectionTwoDisconnect = result.disconnect;
assert.isFalse(result.started);
} catch (error) {
console.log(error);
assert.fail("Develop.connectOrStart should not have thrown!");
assert.isFalse(
result.started,
"Should have connected to established Ganache server"
);
} finally {
//cleanup
if (connectionOneDisconnect) {
Expand Down

0 comments on commit a971288

Please sign in to comment.