found the following hint on how to test middleware in express:
https://github.com/visionmedia/express/blob/master/test/req.xhr.js
I was wondering why my tests were al
You didn't miss anything, it is the express test req.xhr that will never fail.
If running your example, you will see the error stacktrace but the test passes because:
done()
function call.My fixes are in PR #2053:
expect()
to return the assertion error to .end()
.done()
.