eugef / node-mocks-http

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

262 Mocked response throws when sent twice #263

Closed siavol closed 1 year ago

siavol commented 1 year ago

This Pull Request closes #262. It emulates Node.js http in two cases:

  1. .end() throws Error [ERR_STREAM_WRITE_AFTER_END]: write after end error when response is sent
  2. .setHeader() throws Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client error when headers are sent
github-actions[bot] commented 1 year ago

Stale pull request message

github-actions[bot] commented 1 year ago

Stale pull request message