From 7a566dd2016f0da47b66b72fd68680950a026f82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Moreau?= <cem.moreau@gmail.com>
Date: Sun, 17 Dec 2017 16:02:24 +0100
Subject: [PATCH] [fix] tests: remove unhandledRejection EventEmitter leaks

---
 index.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/index.ts b/index.ts
index 6ce4dab8d..e7e6a32e0 100644
--- a/index.ts
+++ b/index.ts
@@ -30,6 +30,12 @@ const pluginDependency    = require('./app/modules/plugin');
 
 let sigintListening = false
 
+// Trace errors
+process.on('unhandledRejection', (reason) => {
+  logger.error('Unhandled rejection: ' + reason);
+  logger.error(reason);
+});
+
 class Stacks {
 
   static todoOnRunDone:() => any = () => process.exit()
@@ -441,12 +447,6 @@ class Stack {
 
   executeStack(argv:string[]) {
 
-    // Trace these errors
-    process.on('unhandledRejection', (reason) => {
-      logger.error('Unhandled rejection: ' + reason);
-      logger.error(reason);
-    });
-
     // Executes the command
     return this.cli.execute(argv);
   }
-- 
GitLab