Skip to content

Commit

Permalink
refactor: add support for normal middleware
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
  • Loading branch information
Sarthak160 committed May 15, 2024
1 parent 8246f85 commit c5e050a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions v2/dedup/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const filePath = 'dedupData.yaml';
export default function middleware(

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

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

// Log to the console
console.log("Executed lines by file:", executedLinesByFile);
console.log("Data has been appended and logged to", filePath);
// console.log("Executed lines by file:", executedLinesByFile);
// console.log("Data has been appended and logged to", filePath);
}

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

let count = 0;
const executedLinebyEachTest = new Array();
function GetCoverage() {
console.log("Inside GetCoverage");
console.log("Calculating per request coverage...");
count++;
let executedLinesByFile = {};
// iterate over global.__coverage__
Expand Down Expand Up @@ -123,7 +123,7 @@ function GetCoverage() {
// @ts-ignore
executedLinebyEachTest.push({ ...hitCounts });

console.log("Executed lines by file:", executedLinesByFile);
// console.log("Executed lines by file:", executedLinesByFile);
// extract s from the coverage data
}
return executedLinesByFile;
Expand Down
2 changes: 1 addition & 1 deletion v2/dedup/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const _ = require('lodash');
const khook = "keployWrappedExpress";
// @ts-ignore
Hook(["express"], function (exports) {
console.log("Inside keploy hook...");
// console.log("Inside keploy hook...");
const expressApp = exports;
function keployWrappedExpress() {
const keployApp = expressApp();
Expand Down

0 comments on commit c5e050a

Please sign in to comment.