eugef / node-mocks-http

Mock 'http' objects for testing Express routing functions
Other
753 stars 133 forks source link

turn mock request into a stream #169

Closed abacaphiliac closed 6 years ago

abacaphiliac commented 6 years ago

http.IncomingMessage extends stream.Readable extends NodeJS.ReadableStream extends NodeJS.EventEmitter.

a mock request that implements stream.Readable (which is-a events.EventEmitter) gets us a little closer to http.IncomingMessage than events.EventEmitter alone.

is there a downside to this approach?

eugef commented 6 years ago

@abacaphiliac thanks for your PR