diff --git a/packages/core/src/_test/e2e/erc20/erc20.test.ts b/packages/core/src/_test/e2e/erc20/erc20.test.ts index e1c1e77b2..c5067eccc 100644 --- a/packages/core/src/_test/e2e/erc20/erc20.test.ts +++ b/packages/core/src/_test/e2e/erc20/erc20.test.ts @@ -35,27 +35,29 @@ const cliOptions = { logFormat: "pretty", }; -test("erc20", async (context) => { - const port = await getFreePort(); +test( + "erc20", + async (context) => { + const port = await getFreePort(); - const cleanup = await start({ - cliOptions: { - ...cliOptions, - command: "start", - port, - }, - }); + const cleanup = await start({ + cliOptions: { + ...cliOptions, + command: "start", + port, + }, + }); - await simulate({ - erc20Address: context.erc20.address, - factoryAddress: context.factory.address, - }); + await simulate({ + erc20Address: context.erc20.address, + factoryAddress: context.factory.address, + }); - await waitForIndexedBlock(port, "mainnet", 8); + await waitForIndexedBlock(port, "mainnet", 8); - const response = await postGraphql( - port, - ` + const response = await postGraphql( + port, + ` accounts { items { address @@ -63,27 +65,29 @@ test("erc20", async (context) => { } } `, - ); - - expect(response.status).toBe(200); - const body = (await response.json()) as any; - expect(body.errors).toBe(undefined); - const accounts = body.data.accounts.items; - expect(accounts[0]).toMatchObject({ - address: zeroAddress, - balance: (-2 * 10 ** 18).toString(), - }); - expect(accounts[1]).toMatchObject({ - address: BOB.toLowerCase(), - balance: (2 * 10 ** 18).toString(), - }); - expect(accounts[2]).toMatchObject({ - address: ALICE.toLowerCase(), - balance: "0", - }); + ); - await cleanup(); -}); + expect(response.status).toBe(200); + const body = (await response.json()) as any; + expect(body.errors).toBe(undefined); + const accounts = body.data.accounts.items; + expect(accounts[0]).toMatchObject({ + address: zeroAddress, + balance: (-2 * 10 ** 18).toString(), + }); + expect(accounts[1]).toMatchObject({ + address: BOB.toLowerCase(), + balance: (2 * 10 ** 18).toString(), + }); + expect(accounts[2]).toMatchObject({ + address: ALICE.toLowerCase(), + balance: "0", + }); + + await cleanup(); + }, + { timeout: 15_000 }, +); const isPglite = !!process.env.DATABASE_URL; diff --git a/packages/core/src/_test/e2e/factory/factory.test.ts b/packages/core/src/_test/e2e/factory/factory.test.ts index 2a866c56a..9f542eb9b 100644 --- a/packages/core/src/_test/e2e/factory/factory.test.ts +++ b/packages/core/src/_test/e2e/factory/factory.test.ts @@ -32,22 +32,24 @@ const cliOptions = { logFormat: "pretty", }; -test("factory", async (context) => { - const port = await getFreePort(); +test( + "factory", + async (context) => { + const port = await getFreePort(); - const cleanup = await start({ - cliOptions: { - ...cliOptions, - command: "start", - port, - }, - }); + const cleanup = await start({ + cliOptions: { + ...cliOptions, + command: "start", + port, + }, + }); - await waitForIndexedBlock(port, "mainnet", 5); + await waitForIndexedBlock(port, "mainnet", 5); - let response = await postGraphql( - port, - ` + let response = await postGraphql( + port, + ` swapEvents { items { id @@ -57,28 +59,28 @@ test("factory", async (context) => { } } `, - ); + ); - expect(response.status).toBe(200); - let body = (await response.json()) as any; - expect(body.errors).toBe(undefined); - let swapEvents = body.data.swapEvents.items; + expect(response.status).toBe(200); + let body = (await response.json()) as any; + expect(body.errors).toBe(undefined); + let swapEvents = body.data.swapEvents.items; - expect(swapEvents).toHaveLength(1); - expect(swapEvents[0]).toMatchObject({ - id: expect.any(String), - from: ALICE.toLowerCase(), - to: ALICE.toLowerCase(), - pair: context.factory.pair.toLowerCase(), - }); + expect(swapEvents).toHaveLength(1); + expect(swapEvents[0]).toMatchObject({ + id: expect.any(String), + from: ALICE.toLowerCase(), + to: ALICE.toLowerCase(), + pair: context.factory.pair.toLowerCase(), + }); - await simulatePairSwap(context.factory.pair); + await simulatePairSwap(context.factory.pair); - await waitForIndexedBlock(port, "mainnet", 6); + await waitForIndexedBlock(port, "mainnet", 6); - response = await postGraphql( - port, - ` + response = await postGraphql( + port, + ` swapEvents { items { id @@ -88,14 +90,16 @@ test("factory", async (context) => { } } `, - ); + ); - expect(response.status).toBe(200); - body = (await response.json()) as any; - expect(body.errors).toBe(undefined); - swapEvents = body.data.swapEvents.items; + expect(response.status).toBe(200); + body = (await response.json()) as any; + expect(body.errors).toBe(undefined); + swapEvents = body.data.swapEvents.items; - expect(swapEvents).toHaveLength(2); + expect(swapEvents).toHaveLength(2); - await cleanup(); -}); + await cleanup(); + }, + { timeout: 15_000 }, +);