diff --git a/test/setup.js b/test/setup.js
index <HASH>..<HASH> 100644
--- a/test/setup.js
+++ b/test/setup.js
@@ -42,4 +42,7 @@ async function main () {
   console.log(web3.fromWei(await web3.eth.getBalanceAsync(config.dp1Acc1), "ether").toString());
 }
 
-main().catch(err => console.log(err));
+main().catch(err => {
+  console.log(err);
+  process.exit(1);
+});
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -83,4 +83,9 @@ async function main () {
   engine.stop();
 }
 
-main().catch((err) => console.log(err));
+main().catch((err) => {
+  console.log(err);
+  if (isNode) {
+    process.exit(1);
+  }
+});
Add process.exit(1) in case of errors