eugef / node-mocks-http

Mock 'http' objects for testing Express,js, Next.js and Koa routing functions
Other
761 stars 135 forks source link

Unable to assign the IncomingMessage object used in the response. #122

Closed fidian closed 7 years ago

fidian commented 7 years ago

This is something that the request object supports but not the response. Restify directly uses http.IncomingMessage and adds methods to its prototype. I don't support this approach, but I didn't write the module. The mock request module uses EventEmitter. If I could have it use an alternate EventEmitter, that would be wonderful. The response mock already allows this but the request is lacking this functionality.

Would this be something you'd be willing to implement?

howardabrams commented 7 years ago

Hrm ... wanna give us a prototype as a PR of what you are thinking?

fidian commented 7 years ago

Nevermind, I see this was added in 3de826b02e0f2817d2fad6298c0c100a9abb471e and is published in the latest version in npm.