Skip to content

Commit 4179475

Browse files
committed
fix(http-mock): await handleRequest in fromExpressStyleHandler
Prevents an async Express-style handler's rejection from becoming an unhandled promise rejection instead of failing the middleware call.
1 parent 6310db9 commit 4179475

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/modules/http/src/mock/adapters/from-express-style-handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export function fromExpressStyleHandler<TRequest = ExpressStyleRequest>(
6969
return async (request) => {
7070
const req = await toRequest(request);
7171
const res = new MockExpressResponse();
72-
handleRequest(req, res);
72+
// Await so a rejecting async handler surfaces here instead of as an unhandled rejection.
73+
await handleRequest(req, res);
7374
return res.done;
7475
};
7576
}

0 commit comments

Comments
 (0)