From 3765a809b1b7913fb388781250b7df937f6ba08f Mon Sep 17 00:00:00 2001 From: avifenesh Date: Wed, 6 Mar 2024 13:10:48 +0000 Subject: [PATCH] added time to afterAll test to avoide failing on timeouts --- node/tests/RedisClient.test.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/node/tests/RedisClient.test.ts b/node/tests/RedisClient.test.ts index 451ab214a9..9b02957225 100644 --- a/node/tests/RedisClient.test.ts +++ b/node/tests/RedisClient.test.ts @@ -46,7 +46,7 @@ describe("RedisClient", () => { if (testsFailed === 0) { await cluster.close(); } - }); + }, 10000); const getAddress = (port: number) => { return [{ host: "localhost", port }]; @@ -54,7 +54,7 @@ describe("RedisClient", () => { const getOptions = ( port: number, - protocol: ProtocolVersion + protocol: ProtocolVersion, ): BaseClientConfiguration => { return { addresses: getAddress(port), @@ -111,23 +111,23 @@ describe("RedisClient", () => { "info without parameters", async (protocol) => { const client = await RedisClient.createClient( - getOptions(port, protocol) + getOptions(port, protocol), ); const result = await client.info(); expect(result).toEqual(expect.stringContaining("# Server")); expect(result).toEqual(expect.stringContaining("# Replication")); expect(result).toEqual( - expect.not.stringContaining("# Latencystats") + expect.not.stringContaining("# Latencystats"), ); client.close(); - } + }, ); it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])( "simple select test", async (protocol) => { const client = await RedisClient.createClient( - getOptions(port, protocol) + getOptions(port, protocol), ); let selectResult = await client.select(0); expect(selectResult).toEqual("OK"); @@ -145,14 +145,14 @@ describe("RedisClient", () => { expect(selectResult).toEqual("OK"); expect(await client.get(key)).toEqual(value); client.close(); - } + }, ); it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])( `can send transactions_%p`, async (protocol) => { const client = await RedisClient.createClient( - getOptions(port, protocol) + getOptions(port, protocol), ); const transaction = new Transaction(); const expectedRes = transactionTest(transaction); @@ -161,17 +161,17 @@ describe("RedisClient", () => { expectedRes.push("OK"); expect(result).toEqual(expectedRes); client.close(); - } + }, ); it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])( "can return null on WATCH transaction failures", async (protocol) => { const client1 = await RedisClient.createClient( - getOptions(port, protocol) + getOptions(port, protocol), ); const client2 = await RedisClient.createClient( - getOptions(port, protocol) + getOptions(port, protocol), ); const transaction = new Transaction(); transaction.get("key"); @@ -186,7 +186,7 @@ describe("RedisClient", () => { client1.close(); client2.close(); - } + }, ); runBaseTests({