Skip to content

Commit 8090c55

Browse files
committed
Sort requests array before asserting contents
1 parent b040fc9 commit 8090c55

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

integration/middleware-test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ test.describe("Middleware", () => {
12531253
await page.waitForSelector("[data-child]");
12541254

12551255
// 2 separate server requests made
1256-
expect(requests).toEqual([
1256+
expect(requests.sort()).toEqual([
12571257
expect.stringContaining("/parent/child.data?_routes=routes%2Fparent"),
12581258
expect.stringContaining(
12591259
"/parent/child.data?_routes=routes%2Fparent.child"
@@ -1415,15 +1415,15 @@ test.describe("Middleware", () => {
14151415
await page.waitForSelector("[data-action]");
14161416

14171417
// 2 separate server requests made
1418-
expect(requests).toEqual([
1419-
// index gets it's own due to clientLoader
1420-
expect.stringMatching(
1421-
/\/parent\/child\.data\?_routes=routes%2Fparent\.child\._index$/
1422-
),
1418+
expect(requests.sort()).toEqual([
14231419
// This is the normal request but only included parent.child because parent opted out
14241420
expect.stringMatching(
14251421
/\/parent\/child\.data\?_routes=routes%2Fparent\.child$/
14261422
),
1423+
// index gets it's own due to clientLoader
1424+
expect.stringMatching(
1425+
/\/parent\/child\.data\?_routes=routes%2Fparent\.child\._index$/
1426+
),
14271427
]);
14281428

14291429
// But client middlewares only ran once for the action and once for the revalidation

0 commit comments

Comments
 (0)