Skip to content

Commit

Permalink
test: do not use await inside a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Dec 12, 2023
1 parent 03d0700 commit 62f00f5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test-e2e/panels/ranges.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,17 @@ test('Automatic ranges detection should work', async ({ page }) => {
{ s: '2.15', r: '0.07' },
{ s: '2.31 - 2.34', r: '1.01' },
];

const testPromises: Array<Promise<void>> = [];
for (const [i, { s, r }] of rangesData.entries()) {
const range = ranges.nth(i);
// eslint-disable-next-line no-await-in-loop
await expect(range).toBeVisible();
// eslint-disable-next-line no-await-in-loop
await expect(range).toContainText(s);
// eslint-disable-next-line no-await-in-loop
await expect(range).toContainText(r);
testPromises.push(
expect(range).toBeVisible(),
expect(range).toContainText(s),
expect(range).toContainText(r),
);
}
await Promise.all(testPromises);
});

test('Multiplicity should be visible', async ({ page }) => {
Expand Down

0 comments on commit 62f00f5

Please sign in to comment.