Skip to content

Commit

Permalink
[patch] fix response status (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmisty authored Sep 10, 2024
1 parent 9b7e6d2 commit 2dd1bc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type CypressDataRequest = {
body?: any;
method?: string;
url: string;
status?: number;
resourceType?: string;
};

Expand Down
4 changes: 4 additions & 0 deletions src/setup/request-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export const logRequestEvents = (requests: FullRequest[], events: EventEmitter)
current.response.data = {};
}

if (!current.response.statusCode) {
current.response.statusCode = res.status;
}

current.response.data.headers = res.headers;

const result = convertToRequestsResponse(current);
Expand Down

0 comments on commit 2dd1bc4

Please sign in to comment.