diff options
| author | jw255 | 2018-02-22 16:57:45 +0000 |
|---|---|---|
| committer | jw255 | 2018-02-22 16:57:45 +0000 |
| commit | 77bfad0307f4e5daea0584a30b0dcf24ccc9ec42 (patch) | |
| tree | 42ce68ae0ebe939d6492a39616158278ed0f61d6 /src | |
| parent | Merge branch 'trh/yarn' into trh/payload-checker (diff) | |
| download | medicine-77bfad0307f4e5daea0584a30b0dcf24ccc9ec42.tar.gz medicine-77bfad0307f4e5daea0584a30b0dcf24ccc9ec42.zip | |
restructuring of tests
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.ts | 11 | ||||
| -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
@@ -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 |
