aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.ts11
-rw-r--r--src/matcher/options.unit.test.ts (renamed from src/matcher/options.test.ts)0
-rw-r--r--src/matcher/types.unit.test.ts (renamed from src/matcher/types.test.ts)0
3 files changed, 8 insertions, 3 deletions
diff --git a/src/app.ts b/src/app.ts
index 4f0e0d7..ef4485e 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -5,17 +5,19 @@ import * as logger from 'morgan';
class App {
public express: ex.Express;
- public logEnabled: boolean = true;
+ private logEnabled: boolean;
- public constructor() {
+ public constructor(enableLog: boolean) {
this.express = ex();
this.middleware();
this.mountRoutes();
+ this.logEnabled = enableLog;
}
// Configure Express middleware.
private middleware(): void {
if (this.logEnabled) {
+ console.log("log enabled")
this.express.use(logger('combined'));
}
this.express.use(bodyParser.json());
@@ -36,4 +38,7 @@ class App {
}
}
-export default new App().express;
+export default new App(true).express;
+export function TestApp(){
+ return new App(false).express;
+}
diff --git a/src/matcher/options.test.ts b/src/matcher/options.unit.test.ts
index ff5763e..ff5763e 100644
--- a/src/matcher/options.test.ts
+++ b/src/matcher/options.unit.test.ts
diff --git a/src/matcher/types.test.ts b/src/matcher/types.unit.test.ts
index 398064c..398064c 100644
--- a/src/matcher/types.test.ts
+++ b/src/matcher/types.unit.test.ts