Skip to content

Commit

Permalink
test: use for of
Browse files Browse the repository at this point in the history
  • Loading branch information
Yizack committed Oct 24, 2024
1 parent ece56d8 commit c6073d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/card.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
});
});
}
});
8 changes: 4 additions & 4 deletions tests/pin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
}
});

0 comments on commit c6073d6

Please sign in to comment.