Skip to content

Commit 00fdd19

Browse files
test: Handles exception in cleanupWireMock
1 parent 542830e commit 00fdd19

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • tests/playwright-tests/src/tests/steps

tests/playwright-tests/src/tests/steps/steps.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ function getWireMockUrl(): string {
3131
export async function cleanupWireMock(request: APIRequestContext) {
3232
const wireMockUrl = getWireMockUrl();
3333

34-
return test.step(`Cleanup WireMock`, async () => {
35-
await request.delete(wireMockUrl);
34+
return test.step(`Cleaning up WireMock`, async () => {
35+
try {
36+
await request.delete(wireMockUrl);
37+
}
38+
catch {
39+
console.warn(`Failed to clean up WireMock requests. Is the WireMock server running? URL: ${wireMockUrl}`);
40+
}
3641
});
3742
}
3843

0 commit comments

Comments
 (0)