Skip to content

Commit

Permalink
make cypress test more resilient to non-json responses
Browse files Browse the repository at this point in the history
  • Loading branch information
DAcodedBEAT authored and respencer committed May 13, 2024
1 parent 85077c8 commit a80fa58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cypress/support/api-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ Cypress.Commands.add(
body: body,
}).then((resp) => {
expect(expectedStatus).to.eq(resp.status);

if (!resp.body) {
return null;
}

return JSON.parse(JSON.stringify(resp.body));
});
},
Expand Down

0 comments on commit a80fa58

Please sign in to comment.