In UI5 Tooling, I can create a custom middleware: https://sap.github.io/ui5-tooling/pages/extensibility/CustomServerMiddleware/
The documentation states:
For this you can plug custom middleware implementations into the internal express server of the UI5 Server module.
This is nice, as, with express, you can use res.send(anyJSON) and it automatically takes care of the headers.
In karma-ui5, the middlewares of UI5 Tooling work out of the box, which is really nice, but it seems like express-based methods are missing from req and res. A middleware using res.send() works with ui5 serve, but fails within karma -- it needs to be replaced with res.setHeader('Content-Type', 'application/json'); res.end(JSON.stringify(...));.
Is this expected? Can improvements be made in karma-ui5 so that UI5 middleware behavior doesn't change when run through karma? Or am I missing something?