Skip to content

response.complete is false in end listener #443

@mikicho

Description

@mikicho

We set the this.response.complete after the response.push(null), which emits the end event.
Therefore, I think the response.complete is always false in the end event.

IIUC the docs, it should be true:
https://nodejs.org/api/http.html#messagecomplete

I think we should switch these lines: https://github.com/mswjs/interceptors/blob/main/src/interceptors/ClientRequest/NodeClientRequest.ts#L489-L490

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions