Skip to content

Commit 0b54cf4

Browse files
replace incorrect expect calls with await in middleware e2es (#267)
1 parent e6078b5 commit 0b54cf4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/middleware/e2e/base.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ import { test, expect } from "@playwright/test";
33
test("redirect", async ({ page }) => {
44
await page.goto("/");
55
await page.click('[href="/about"]');
6-
expect(page.waitForURL("**/redirected"));
6+
await page.waitForURL("**/redirected");
77
expect(await page.textContent("h1")).toContain("Redirected");
88
});
99

1010
test("rewrite", async ({ page }) => {
1111
await page.goto("/");
1212
await page.click('[href="/another"]');
13-
expect(page.waitForURL("**/another"));
13+
await page.waitForURL("**/another");
1414
expect(await page.textContent("h1")).toContain("Rewrite");
1515
});
1616

1717
test("no matching middleware", async ({ page }) => {
1818
await page.goto("/");
1919
await page.click('[href="/about2"]');
20-
expect(page.waitForURL("**/about2"));
20+
await page.waitForURL("**/about2");
2121
expect(await page.textContent("h1")).toContain("About 2");
2222
});
2323

2424
test("matching noop middleware", async ({ page }) => {
2525
await page.goto("/");
2626
await page.click('[href="/middleware"]');
27-
expect(page.waitForURL("**/middleware"));
27+
await page.waitForURL("**/middleware");
2828
expect(await page.textContent("h1")).toContain("Via middleware");
2929
});
3030

0 commit comments

Comments
 (0)