Skip to content

Commit c5e050a

Browse files
committed
refactor: add support for normal middleware
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
1 parent 8246f85 commit c5e050a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

v2/dedup/middleware.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const filePath = 'dedupData.yaml';
1111
export default function middleware(
1212

1313
): (req: Request, res: Response, next: NextFunction) => void {
14-
console.log("Inside middleware...");
14+
// console.log("Inside middleware...");
1515

1616
// @ts-ignore
1717
fs.access(filePath, fs.constants.F_OK, (err) => {
@@ -71,16 +71,16 @@ export function afterMiddleware(req: Request, res: Response) {
7171
fs.writeFileSync(filePath, yamlData, 'utf-8');
7272

7373
// Log to the console
74-
console.log("Executed lines by file:", executedLinesByFile);
75-
console.log("Data has been appended and logged to", filePath);
74+
// console.log("Executed lines by file:", executedLinesByFile);
75+
// console.log("Data has been appended and logged to", filePath);
7676
}
7777

7878
// isJsonValid checks whether o is a valid JSON or not
7979

8080
let count = 0;
8181
const executedLinebyEachTest = new Array();
8282
function GetCoverage() {
83-
console.log("Inside GetCoverage");
83+
console.log("Calculating per request coverage...");
8484
count++;
8585
let executedLinesByFile = {};
8686
// iterate over global.__coverage__
@@ -123,7 +123,7 @@ function GetCoverage() {
123123
// @ts-ignore
124124
executedLinebyEachTest.push({ ...hitCounts });
125125

126-
console.log("Executed lines by file:", executedLinesByFile);
126+
// console.log("Executed lines by file:", executedLinesByFile);
127127
// extract s from the coverage data
128128
}
129129
return executedLinesByFile;

v2/dedup/register.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const _ = require('lodash');
88
const khook = "keployWrappedExpress";
99
// @ts-ignore
1010
Hook(["express"], function (exports) {
11-
console.log("Inside keploy hook...");
11+
// console.log("Inside keploy hook...");
1212
const expressApp = exports;
1313
function keployWrappedExpress() {
1414
const keployApp = expressApp();

0 commit comments

Comments
 (0)