{"action":"opened","issue":{"url":"https://api.github.com/repos/visionmedia/supertest/issues/236","labels_url":"https://api.github.com/repos/visionmedia/supertest/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/visionmedia/supertest/issues/236/comments","events_url":"https://api.github.com/repos/visionmedia/supertest/issues/236/events","html_url":"https://github.com/visionmedia/supertest/issues/236","id":81902803,"number":236,"title":"expect(function(res) {}) is implemented inconsistent to documentation","user":{"login":"saintedlama","id":123820,"avatar_url":"https://avatars.githubusercontent.com/u/123820?v=3","gravatar_id":"","url":"https://api.github.com/users/saintedlama","html_url":"https://github.com/saintedlama","followers_url":"https://api.github.com/users/saintedlama/followers","following_url":"https://api.github.com/users/saintedlama/following{/other_user}","gists_url":"https://api.github.com/users/saintedlama/gists{/gist_id}","starred_url":"https://api.github.com/users/saintedlama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saintedlama/subscriptions","organizations_url":"https://api.github.com/users/saintedlama/orgs","repos_url":"https://api.github.com/users/saintedlama/repos","events_url":"https://api.github.com/users/saintedlama/events{/privacy}","received_events_url":"https://api.github.com/users/saintedlama/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-28T12:18:31Z","updated_at":"2015-05-28T12:18:31Z","closed_at":null,"body":"The `expect(function(res) {})` documentation states:\r\n\r\n> Pass a custom assertion function. It'll be given the response object to check. If the response is ok, it should return falsy, most commonly by not returning anything. If the check fails, throw an error or return a truthy value like a string that'll be turned into an error.\r\n\r\nBut in file `lib\\test.js` at line 223 (https://github.com/visionmedia/supertest/blob/master/lib/test.js#L223) the following condition is implemented\r\n\r\n`if (!(err instanceof Error)) continue;`\r\n\r\nwhich effectively treats any non truthy value that is not an `Error` as a falsy value.\r\n\r\n\r\n"}}