eugef / node-mocks-http

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

setHeader should return `this` #268

Closed jeysal closed 1 year ago

jeysal commented 1 year ago

You can try in Node e.g. new (require('http').OutgoingMessage)().setHeader('a', 'b').setHeader('b', 'c')

jeysal commented 1 year ago

This could be considered a breaking change, but I would consider it a bugfix

eugef commented 1 year ago

Hi @jeysal, thanks for your contribution.

I tend to agree with you, it looks more like a bug fix that will make mock compatible with the actual implementation