supertest test express middleware
问题 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 always passing. Until I noticed that when i copied the test from express they behaved the same. I tried screwing them up but they keep passing: https://github.com/visionmedia/express/blob/master/test/req.xhr.js What am I missing here? it('should return true when X-Requested-With is xmlhttprequest', function(done){ var app = express