File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export function afterMiddleware(req: Request, res: Response) {
80
80
let count = 0 ;
81
81
const executedLinebyEachTest = new Array ( ) ;
82
82
function GetCoverage ( ) {
83
- console . log ( "Inside GetCoverage " ) ;
83
+ console . log ( "Calculating per request coverage... " ) ;
84
84
count ++ ;
85
85
let executedLinesByFile = { } ;
86
86
// iterate over global.__coverage__
@@ -123,8 +123,10 @@ function GetCoverage() {
123
123
// @ts -ignore
124
124
executedLinebyEachTest . push ( { ...hitCounts } ) ;
125
125
126
- console . log ( "Executed lines by file:" , executedLinesByFile ) ;
126
+ // console.log("Executed lines by file:", executedLinesByFile);
127
127
// extract s from the coverage data
128
128
}
129
129
return executedLinesByFile ;
130
130
}
131
+
132
+ module . exports = middleware ;
Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ import Hook from "require-in-the-middle";
3
3
import expressMiddleware from "./middleware" ;
4
4
import bodyParser from "body-parser" ;
5
5
import cors from "cors" ;
6
- // import mixin from "merge-descriptors";
7
- const _ = require ( 'lodash' ) ;
8
6
7
+ const _ = require ( 'lodash' ) ;
8
+ const khook = "keployWrappedExpress" ;
9
9
// @ts -ignore
10
10
Hook ( [ "express" ] , function ( exports ) {
11
+ // console.log("Inside keploy hook...");
11
12
const expressApp = exports ;
12
13
function keployWrappedExpress ( ) {
13
14
const keployApp = expressApp ( ) ;
@@ -18,12 +19,12 @@ Hook(["express"], function (exports) {
18
19
keployApp . appliedMiddleware = true ;
19
20
return keployApp ;
20
21
}
21
-
22
+
22
23
// copy the properties and methods of exported Function object into wrapped Funtion(keployWrappedExpress).
23
24
// In order to prevent "express._Method_ or express._Field_ is not declared" error.
24
25
// mixin(keployWrappedExpress, expressApp, false);
25
26
_ . assign ( keployWrappedExpress , expressApp ) ;
26
27
exports = keployWrappedExpress ;
27
28
return exports ;
28
29
} ) ;
29
- export { } ;
30
+ export { khook } ;
You can’t perform that action at this time.
0 commit comments