Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: expose middleware for dist usage #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions 6 v2/dedup/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function afterMiddleware(req: Request, res: Response) {
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,8 +123,10 @@ 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;
}

module.exports = middleware;
9 changes: 5 additions & 4 deletions 9 v2/dedup/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import Hook from "require-in-the-middle";
import expressMiddleware from "./middleware";
import bodyParser from "body-parser";
import cors from "cors";
// import mixin from "merge-descriptors";
const _ = require('lodash');

const _ = require('lodash');
const khook = "keployWrappedExpress";
// @ts-ignore
Hook(["express"], function (exports) {
// console.log("Inside keploy hook...");
const expressApp = exports;
function keployWrappedExpress() {
const keployApp = expressApp();
Expand All @@ -18,12 +19,12 @@ Hook(["express"], function (exports) {
keployApp.appliedMiddleware = true;
return keployApp;
}

// copy the properties and methods of exported Function object into wrapped Funtion(keployWrappedExpress).
// In order to prevent "express._Method_ or express._Field_ is not declared" error.
// mixin(keployWrappedExpress, expressApp, false);
_.assign(keployWrappedExpress, expressApp);
exports = keployWrappedExpress;
return exports;
});
export { };
export { khook };
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.