UNPKG

7.76 kBHTMLView Raw
1<!doctype html>
2<html lang="en">
3<head>
4 <title>Code coverage report for LoggerMiddleware.ts</title>
5 <meta charset="utf-8" />
6 <link rel="stylesheet" href="prettify.css" />
7 <link rel="stylesheet" href="base.css" />
8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 <style type='text/css'>
10 .coverage-summary .sorter {
11 background-image: url(sort-arrow-sprite.png);
12 }
13 </style>
14</head>
15<body>
16<div class='wrapper'>
17 <div class='pad1'>
18 <h1>
19 <a href="index.html">All files</a> LoggerMiddleware.ts
20 </h1>
21 <div class='clearfix'>
22 <div class='fl pad1y space-right2'>
23 <span class="strong">42.86% </span>
24 <span class="quiet">Statements</span>
25 <span class='fraction'>3/7</span>
26 </div>
27 <div class='fl pad1y space-right2'>
28 <span class="strong">100% </span>
29 <span class="quiet">Branches</span>
30 <span class='fraction'>0/0</span>
31 </div>
32 <div class='fl pad1y space-right2'>
33 <span class="strong">0% </span>
34 <span class="quiet">Functions</span>
35 <span class='fraction'>0/3</span>
36 </div>
37 <div class='fl pad1y space-right2'>
38 <span class="strong">42.86% </span>
39 <span class="quiet">Lines</span>
40 <span class='fraction'>3/7</span>
41 </div>
42 </div>
43 <p class="quiet">
44 Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
45 </p>
46 </div>
47 <div class='status-line low'></div>
48<pre><table class="coverage">
49<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
50<a name='L2'></a><a href='#L2'>2</a>
51<a name='L3'></a><a href='#L3'>3</a>
52<a name='L4'></a><a href='#L4'>4</a>
53<a name='L5'></a><a href='#L5'>5</a>
54<a name='L6'></a><a href='#L6'>6</a>
55<a name='L7'></a><a href='#L7'>7</a>
56<a name='L8'></a><a href='#L8'>8</a>
57<a name='L9'></a><a href='#L9'>9</a>
58<a name='L10'></a><a href='#L10'>10</a>
59<a name='L11'></a><a href='#L11'>11</a>
60<a name='L12'></a><a href='#L12'>12</a>
61<a name='L13'></a><a href='#L13'>13</a>
62<a name='L14'></a><a href='#L14'>14</a>
63<a name='L15'></a><a href='#L15'>15</a>
64<a name='L16'></a><a href='#L16'>16</a>
65<a name='L17'></a><a href='#L17'>17</a>
66<a name='L18'></a><a href='#L18'>18</a>
67<a name='L19'></a><a href='#L19'>19</a>
68<a name='L20'></a><a href='#L20'>20</a>
69<a name='L21'></a><a href='#L21'>21</a>
70<a name='L22'></a><a href='#L22'>22</a>
71<a name='L23'></a><a href='#L23'>23</a>
72<a name='L24'></a><a href='#L24'>24</a>
73<a name='L25'></a><a href='#L25'>25</a>
74<a name='L26'></a><a href='#L26'>26</a>
75<a name='L27'></a><a href='#L27'>27</a>
76<a name='L28'></a><a href='#L28'>28</a>
77<a name='L29'></a><a href='#L29'>29</a>
78<a name='L30'></a><a href='#L30'>30</a>
79<a name='L31'></a><a href='#L31'>31</a>
80<a name='L32'></a><a href='#L32'>32</a>
81<a name='L33'></a><a href='#L33'>33</a>
82<a name='L34'></a><a href='#L34'>34</a>
83<a name='L35'></a><a href='#L35'>35</a>
84<a name='L36'></a><a href='#L36'>36</a>
85<a name='L37'></a><a href='#L37'>37</a>
86<a name='L38'></a><a href='#L38'>38</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
87<span class="cline-any cline-neutral">&nbsp;</span>
88<span class="cline-any cline-neutral">&nbsp;</span>
89<span class="cline-any cline-neutral">&nbsp;</span>
90<span class="cline-any cline-neutral">&nbsp;</span>
91<span class="cline-any cline-neutral">&nbsp;</span>
92<span class="cline-any cline-neutral">&nbsp;</span>
93<span class="cline-any cline-neutral">&nbsp;</span>
94<span class="cline-any cline-neutral">&nbsp;</span>
95<span class="cline-any cline-neutral">&nbsp;</span>
96<span class="cline-any cline-neutral">&nbsp;</span>
97<span class="cline-any cline-neutral">&nbsp;</span>
98<span class="cline-any cline-neutral">&nbsp;</span>
99<span class="cline-any cline-neutral">&nbsp;</span>
100<span class="cline-any cline-neutral">&nbsp;</span>
101<span class="cline-any cline-yes">1x</span>
102<span class="cline-any cline-neutral">&nbsp;</span>
103<span class="cline-any cline-neutral">&nbsp;</span>
104<span class="cline-any cline-yes">1x</span>
105<span class="cline-any cline-neutral">&nbsp;</span>
106<span class="cline-any cline-neutral">&nbsp;</span>
107<span class="cline-any cline-yes">1x</span>
108<span class="cline-any cline-neutral">&nbsp;</span>
109<span class="cline-any cline-no">&nbsp;</span>
110<span class="cline-any cline-neutral">&nbsp;</span>
111<span class="cline-any cline-neutral">&nbsp;</span>
112<span class="cline-any cline-neutral">&nbsp;</span>
113<span class="cline-any cline-no">&nbsp;</span>
114<span class="cline-any cline-neutral">&nbsp;</span>
115<span class="cline-any cline-no">&nbsp;</span>
116<span class="cline-any cline-no">&nbsp;</span>
117<span class="cline-any cline-neutral">&nbsp;</span>
118<span class="cline-any cline-neutral">&nbsp;</span>
119<span class="cline-any cline-neutral">&nbsp;</span>
120<span class="cline-any cline-neutral">&nbsp;</span>
121<span class="cline-any cline-neutral">&nbsp;</span>
122<span class="cline-any cline-neutral">&nbsp;</span>
123<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">// Copyright (C) 2017 Norman Breau
124&nbsp;
125// This program is free software: you can redistribute it and/or modify
126// it under the terms of the GNU General Public License as published by
127// the Free Software Foundation, either version 3 of the License, or
128// (at your option) any later version.
129&nbsp;
130// This program is distributed in the hope that it will be useful,
131// but WITHOUT ANY WARRANTY; without even the implied warranty of
132// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
133// GNU General Public License for more details.
134&nbsp;
135// You should have received a copy of the GNU General Public License
136// along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
137&nbsp;
138import {Middleware} from './Middleware';
139import {Request} from './Request';
140import {Response} from './Response';
141import {getApplicationLogger} from './instance';
142import {IRequestResponse} from './IRequestResponse';
143&nbsp;
144export class LoggerMiddleware extends Middleware {
145<span class="fstat-no" title="function not covered" > public constructor() {</span>
146<span class="cstat-no" title="statement not covered" > super();</span>
147 }
148&nbsp;
149 public <span class="fstat-no" title="function not covered" >execute(</span>request: Request, response: Response, options?: any): Promise&lt;IRequestResponse&gt; {
150<span class="cstat-no" title="statement not covered" > return new Promise&lt;IRequestResponse&gt;(<span class="fstat-no" title="function not covered" >(r</span>esolve, reject) =&gt; {</span>
151 // tslint:disable-next-line max-line-length
152<span class="cstat-no" title="statement not covered" > getApplicationLogger().info(`${request.getForwardedIP()} (${request.getIP()}) - ${request.getMethod()} ${request.getURL()} - UA(${request.getHeader('user-agent')})`);</span>
153<span class="cstat-no" title="statement not covered" > resolve({</span>
154 request: request,
155 response: response
156 });
157 });
158 }
159}
160&nbsp;</pre></td></tr>
161</table></pre>
162<div class='push'></div><!-- for sticky footer -->
163</div><!-- /wrapper -->
164<div class='footer quiet pad2 space-top1 center small'>
165 Code coverage
166 generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sun Sep 22 2019 22:27:15 GMT-0300 (Atlantic Daylight Time)
167</div>
168</div>
169<script src="prettify.js"></script>
170<script>
171window.onload = function () {
172 if (typeof prettyPrint === 'function') {
173 prettyPrint();
174 }
175};
176</script>
177<script src="sorter.js"></script>
178<script src="block-navigation.js"></script>
179</body>
180</html>