visionmedia/supertest — pull request #67 by kirbysayshi (2013-06-29 04:08:05+00:00)
Title: failing tests to demonstrate .pipe problems

This is a followup PR for #49. The question is: how to fix these based on how people think supertest should behave? Or of course I could be doing something wrong as well :)

There are two issues, as outlined in the comments, reproduced below:

1) .pipe returns this.end().req.on(...). `this` of .on is http(s) Request, not supertest, meaning calls to `expect`, `assert`, etc fail because they don't exist

2) .pipe, defined in superagent Request#pipe, calls `this.end()...` without an fn arg. `this.end` is actually Test#end, which has no guards for an undefined callback. What should the behavior of `this.end` with no callback be in supertest when there are errors?