Skip to content

Commit bdea9c9

Browse files
author
J K
committed
Move updated response to own variable
1 parent abb80aa commit bdea9c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/api/pet-v2.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ test(`CRUD - Pet`, ({ request }) => {
4646

4747
// UPDATE pet status
4848
test.step(`PUT - doggie`, async () => {
49+
const updatedResponse = { ...expectedResponse, status: "sold" };
50+
4951
const response = await request.put(`/v2/pet`, {
5052
headers: {
5153
"Content-Type": "application/json",
5254
accept: "application/json",
5355
},
54-
data: JSON.stringify({ ...expectedResponse, status: "sold" }),
56+
data: JSON.stringify(updatedResponse),
5557
});
5658

5759
expect(await response.json()).toEqual(
58-
expect.objectContaining({ ...expectedResponse, status: "sold" })
60+
expect.objectContaining(updatedResponse)
5961
);
6062
});
6163
});

0 commit comments

Comments
 (0)