From 8c34f19e3fffb4d9b272441a95963ec9317ae66c Mon Sep 17 00:00:00 2001
From: Sorunome <mail@sorunome.de>
Date: Wed, 7 Nov 2018 14:55:43 +0100
Subject: [PATCH] add why-is-node-running

---
 .gitignore        |  1 +
 package-lock.json | 15 +++++++++++++++
 package.json      |  3 ++-
 test/config.ts    | 11 +++++++++--
 test/mocha.opts   |  1 +
 5 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index a64870e..33f4a0a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ logs
 *.log.*
 npm-debug.log*
 .audit.json
+*-audit.json
 
 # Runtime data
 pids
diff --git a/package-lock.json b/package-lock.json
index 710146b..e924536 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2674,6 +2674,12 @@
       "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
       "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
     },
+    "stackback": {
+      "version": "0.0.2",
+      "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+      "integrity": "sha1-Gsig2Ug4SNFpXkGLbQMaPDzmjjs=",
+      "dev": true
+    },
     "statuses": {
       "version": "1.5.0",
       "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
@@ -3063,6 +3069,15 @@
         "isexe": "^2.0.0"
       }
     },
+    "why-is-node-running": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.0.3.tgz",
+      "integrity": "sha512-XmzbFN2T859avcs5qAsiiK1iu0nUpSUXRgiGsoHPcNijxhIlp1bPQWQk6ANUljDWqBtAbIR2jF1HxR0y2l2kCA==",
+      "dev": true,
+      "requires": {
+        "stackback": "0.0.2"
+      }
+    },
     "winston": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/winston/-/winston-3.1.0.tgz",
diff --git a/package.json b/package.json
index 000fab9..3eb9148 100644
--- a/package.json
+++ b/package.json
@@ -64,6 +64,7 @@
     "eslint": "^3.8.1",
     "istanbul": "^0.4.5",
     "mocha": "^5.2.0",
-    "proxyquire": "^1.7.11"
+    "proxyquire": "^1.7.11",
+    "why-is-node-running": "^2.0.3"
   }
 }
diff --git a/test/config.ts b/test/config.ts
index 12cd897..611df1d 100644
--- a/test/config.ts
+++ b/test/config.ts
@@ -1,5 +1,8 @@
-import {argv} from "process";
-import {Log} from "../src/log";
+import { argv } from "process";
+import { Log } from "../src/log";
+import * as WhyRunning from "why-is-node-running";
+
+const logger = new Log("MessageProcessor");
 
 // we are a test file and thus need those
 /* tslint:disable:no-unused-expression max-file-line-count */
@@ -7,3 +10,7 @@ import {Log} from "../src/log";
 if (!argv.includes("--noisy")) {
     Log.ForceSilent();
 }
+
+after(() => {
+    WhyRunning();
+});
diff --git a/test/mocha.opts b/test/mocha.opts
index a93481d..d968e94 100644
--- a/test/mocha.opts
+++ b/test/mocha.opts
@@ -1,3 +1,4 @@
 --reporter list
 --ui bdd
 --recursive
+--expose-internals
-- 
GitLab