diff options
| author | jw255 | 2018-02-24 17:13:43 +0000 |
|---|---|---|
| committer | jw255 | 2018-02-24 17:13:43 +0000 |
| commit | f66a9fa7f132f41b2e40029f0fb535521c3fb716 (patch) | |
| tree | 31c7a774d656ef833254e48ef3bfc86a2af8a73a /coverage/project-code/src/app.ts.html | |
| parent | restructuring of tests (diff) | |
| download | medicine-f66a9fa7f132f41b2e40029f0fb535521c3fb716.tar.gz medicine-f66a9fa7f132f41b2e40029f0fb535521c3fb716.zip | |
restructuring of tests + yarn install script
Diffstat (limited to 'coverage/project-code/src/app.ts.html')
| -rw-r--r-- | coverage/project-code/src/app.ts.html | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/coverage/project-code/src/app.ts.html b/coverage/project-code/src/app.ts.html new file mode 100644 index 0000000..60f3e87 --- /dev/null +++ b/coverage/project-code/src/app.ts.html @@ -0,0 +1,197 @@ +<!doctype html> +<html lang="en"> +<head> + <title>Code coverage report for project-code/src/app.ts</title> + <meta charset="utf-8" /> + <link rel="stylesheet" href="../../prettify.css" /> + <link rel="stylesheet" href="../../base.css" /> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <style type='text/css'> + .coverage-summary .sorter { + background-image: url(../../sort-arrow-sprite.png); + } + </style> +</head> +<body> +<div class='wrapper'> + <div class='pad1'> + <h1> + <a href="../../index.html">All files</a> / <a href="index.html">project-code/src</a> app.ts + </h1> + <div class='clearfix'> + <div class='fl pad1y space-right2'> + <span class="strong">90.48% </span> + <span class="quiet">Statements</span> + <span class='fraction'>19/21</span> + </div> + <div class='fl pad1y space-right2'> + <span class="strong">50% </span> + <span class="quiet">Branches</span> + <span class='fraction'>1/2</span> + </div> + <div class='fl pad1y space-right2'> + <span class="strong">100% </span> + <span class="quiet">Functions</span> + <span class='fraction'>5/5</span> + </div> + <div class='fl pad1y space-right2'> + <span class="strong">90.48% </span> + <span class="quiet">Lines</span> + <span class='fraction'>19/21</span> + </div> + </div> + </div> + <div class='status-line high'></div> +<pre><table class="coverage"> +<tr><td class="line-count quiet">1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-no"> </span> +<span class="cline-any cline-no"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">3x</span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-yes">2x</span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-yes">1x</span> +<span class="cline-any cline-neutral"> </span> +<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import * as bodyParser from 'body-parser'; +import * as ex from 'express'; +import FileRouter from './FileRouter'; +import * as logger from 'morgan'; + +class App { + public express: ex.Express; + private logEnabled: boolean; + + public constructor(enableLog: boolean) { + this.express = ex(); + this.middleware(); + this.mountRoutes(); + this.logEnabled = enableLog; + } + + // Configure Express middleware. + private middleware(): void { + <span class="missing-if-branch" title="if path not taken" >I</span>if (this.logEnabled) { +<span class="cstat-no" title="statement not covered" > console.log("log enabled")</span> +<span class="cstat-no" title="statement not covered" > this.express.use(logger('combined'));</span> + } + this.express.use(bodyParser.json()); + this.express.use(bodyParser.urlencoded({ extended: false })); + } + + // Configure API endpoints. + private mountRoutes(): void { + const defRouter: ex.Router = ex.Router(); + defRouter.get('/', (req: ex.Request, res: ex.Response): void => { + res.json({ + message: 'Welcome to the CS3099 BE4 server!', + important : 'Endpoints start from /cs3099group-be-4/' + }); + }); + this.express.use('/', defRouter); + this.express.use('/cs3099group-be-4', FileRouter); + } +} + +export default new App(true).express; +export function TestApp(){ + return new App(false).express; +} + </pre></td></tr> +</table></pre> +<div class='push'></div><!-- for sticky footer --> +</div><!-- /wrapper --> +<div class='footer quiet pad2 space-top1 center small'> + Code coverage + generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sat Feb 24 2018 16:06:15 GMT+0000 (GMT) +</div> +</div> +<script src="../../prettify.js"></script> +<script> +window.onload = function () { + if (typeof prettyPrint === 'function') { + prettyPrint(); + } +}; +</script> +<script src="../../sorter.js"></script> +</body> +</html> |
