eugef / node-mocks-http

Mock 'http' objects for testing Express routing functions
Other
747 stars 131 forks source link

response missing getHeaders api #211

Closed feifeipan closed 3 years ago

feifeipan commented 4 years ago

response missing getHeaders() api, only support getHeader().

edshav commented 4 years ago

const cookie = res._getHeaders()['set-cookie']; It works for me

sergioregueira commented 3 years ago

As response.getHeaders() is part of the spec, the mock should implement it instead of requiring users to adapt their valid implementation. I will submit today a pull request to add that missing method.

eugef commented 3 years ago

Hi @sergioregueira, that would be great.