lemaiwo / ui5-middleware-route-proxy

UI5Tooling route proxy
MIT License
11 stars 4 forks source link

Proxy makes Karma tests fail #8

Open geert-janklaps opened 4 years ago

geert-janklaps commented 4 years ago

When using this middleware in combination with Karma tests, the middleware makes the tests fail. image

Didn't have the time yet to dive into this one myself. I included this middleware as the default proxy for on-premise developments in the easy-ui5 generator. (details can be found here)

toadslop commented 3 years ago

I had this exact problem.

toadslop commented 3 years ago

I solved this issue. Go into proxy.js and add an if statement checking if res.header() exists before running code that uses the function. It seems karma produces some result that doesn't have this, but the proxy expects it to always be there. If you add that if statement, it'll run fine. (I patched it using patch-package).