Skip to content

Commit ecf3798

Browse files
chore: add fs route test
1 parent 7cb796f commit ecf3798

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/fs_routes_test.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,3 +1542,25 @@ Deno.test("fsRoutes - call correct middleware", async () => {
15421542
text = await res.text();
15431543
expect(text).toEqual("_middleware");
15441544
});
1545+
1546+
// Issue: https://github.com/denoland/fresh/issues/2045
1547+
Deno.test("fsRoutes - merge group methods", async () => {
1548+
const server = await createServer({
1549+
"routes/(foo)/bar/index.ts": {
1550+
handler: {
1551+
POST: () => new Response("POST ok"),
1552+
},
1553+
},
1554+
"routes/bar/index.ts": {
1555+
handler: {
1556+
GET: () => new Response("GET ok"),
1557+
},
1558+
},
1559+
});
1560+
1561+
let res = await server.get("/bar");
1562+
expect(await res.text()).toEqual("GET ok");
1563+
1564+
res = await server.post("/bar");
1565+
expect(await res.text()).toEqual("POST ok");
1566+
});

0 commit comments

Comments
 (0)