From c6073d690ff3512cf108f4f7db77a686c7654880 Mon Sep 17 00:00:00 2001 From: Yizack Rangel Date: Thu, 24 Oct 2024 08:11:09 -0500 Subject: [PATCH] test: use for of --- tests/card.test.js | 8 ++++---- tests/pin.test.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/card.test.js b/tests/card.test.js index d7b553e..44b442f 100644 --- a/tests/card.test.js +++ b/tests/card.test.js @@ -46,17 +46,17 @@ const emptyCard = [ ]; describe("getCard", () => { - definedCard.forEach((query) => { + for (const query of definedCard) { it(`${JSON.stringify(query)} - should return card`, async () => { const card = getCard(query, fakeGists); expect(card).toBeDefined(); }); - }); + } - emptyCard.forEach((query) => { + for (const query of emptyCard) { it(`${JSON.stringify(query)} - should return empty card`, async () => { const card = getCard(query, []); expect(card.gists).toStrictEqual([]); }); - }); + } }); diff --git a/tests/pin.test.js b/tests/pin.test.js index e8f5657..9944c1c 100644 --- a/tests/pin.test.js +++ b/tests/pin.test.js @@ -43,17 +43,17 @@ const emptyPin = [ ]; describe("getPin", () => { - definedPin.forEach((query) => { + for (const query of definedPin) { it(`${JSON.stringify(query)} - should return pin`, async () => { const pin = await getPin(query, fakeGist); expect(pin).toBeDefined(); }); - }); + } - emptyPin.forEach((query) => { + for (const query of emptyPin) { it(`${JSON.stringify(query)} - should return empty pin`, async () => { const pin = await getPin(query, fakeNULL); expect(pin.filename).toBeUndefined(); }); - }); + } });