From 0f7f332583b4588eaacdd651e52c07854775e63c Mon Sep 17 00:00:00 2001 From: barbmarcio Date: Mon, 5 Aug 2024 22:08:52 +0100 Subject: [PATCH] fix: reduce timeout for test --- e2e/auctions.test.ts | 15 +++------------ e2e/events.test.ts | 7 ------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/e2e/auctions.test.ts b/e2e/auctions.test.ts index b79da18..76b4c9d 100644 --- a/e2e/auctions.test.ts +++ b/e2e/auctions.test.ts @@ -48,9 +48,6 @@ test.describe("Create Auction via Topsort SDK", () => { }, ], }; - if (typeof window.sdk.createAuction === "undefined") { - throw new Error("Global function `createAuction` is not available."); - } return window.sdk.createAuction(config, auctionDetails); }); @@ -89,9 +86,6 @@ test.describe("Create Auction via Topsort SDK", () => { }, ], }; - if (typeof window.sdk.createAuction === "undefined") { - throw new Error("Global function `createAuction` is not available."); - } return window.sdk.createAuction(config, auctionDetails); }); @@ -111,7 +105,7 @@ test.describe("Create Auction via Topsort SDK", () => { }; await page.route(`${baseURL}/${apis.auctions}`, async (route) => { - await delay(2000); + await delay(100); await route.fulfill({ json: mockAPIResponse }); }); @@ -120,7 +114,7 @@ test.describe("Create Auction via Topsort SDK", () => { const startTime = Date.now(); const config = { apiKey: "rando-api-key", - timeOut: 2000, + timeOut: 100, }; const auctionDetails = { @@ -133,9 +127,6 @@ test.describe("Create Auction via Topsort SDK", () => { }, ], }; - if (typeof window.sdk.createAuction === "undefined") { - throw new Error("Global function `createAuction` is not available."); - } const createAuctionResult = await window.sdk.createAuction(config, auctionDetails); const endTime = Date.now(); @@ -143,6 +134,6 @@ test.describe("Create Auction via Topsort SDK", () => { }); expect(result.createAuctionResult).toEqual(mockAPIResponse); - expect(result.timeTaken).toBeGreaterThanOrEqual(2000); + expect(result.timeTaken).toBeGreaterThanOrEqual(100); }); }); diff --git a/e2e/events.test.ts b/e2e/events.test.ts index 438b19a..2fff178 100644 --- a/e2e/events.test.ts +++ b/e2e/events.test.ts @@ -34,10 +34,6 @@ test.describe("Report Events via Topsort SDK", () => { ], }; - if (typeof window.sdk.reportEvent === "undefined") { - throw new Error("Global function `reportEvent` is not available."); - } - return window.sdk.reportEvent(config, event); }); @@ -71,9 +67,6 @@ test.describe("Report Events via Topsort SDK", () => { }, ], }; - if (typeof window.sdk.reportEvent === "undefined") { - throw new Error("Global function `reportEvent` is not available."); - } return window.sdk.reportEvent(config, event); });