diff --git a/src/common/utils.ts b/src/common/utils.ts index c13225c..56a88b8 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -18,6 +18,7 @@ export type CypressDataRequest = { body?: any; method?: string; url: string; + status?: number; resourceType?: string; }; diff --git a/src/setup/request-events.ts b/src/setup/request-events.ts index d8c9840..1ab8185 100644 --- a/src/setup/request-events.ts +++ b/src/setup/request-events.ts @@ -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);