fixes handlers not being compatible with deno handlers

This commit is contained in:
2024-11-11 12:41:56 -07:00
parent 05831b364b
commit 67ddb71fdd
3 changed files with 7 additions and 7 deletions

View File

@@ -49,7 +49,7 @@ describe("Router", () => {
describe("Route Parameters", () => {
it("should handle route parameters", async () => {
router.route("/users/:id")
.get(async (ctx) => new Response(ctx.params.id));
.get(async (_, ctx) => new Response(ctx.params.id));
const req = new Request("http://localhost/users/123", {
method: "GET",
@@ -61,7 +61,7 @@ describe("Router", () => {
it("should handle multiple route parameters", async () => {
router.route("/users/:userId/posts/:postId")
.get(async (ctx) => {
.get(async (_, ctx) => {
return new Response(JSON.stringify(ctx.params));
});
@@ -182,7 +182,7 @@ describe("Router", () => {
it("should handle nested routes with parameters", async () => {
const apiRouter = new Router();
apiRouter.route("/users/:id")
.get(async (ctx) => new Response(ctx.params.id));
.get(async (_, ctx) => new Response(ctx.params.id));
router.use("/api/:version", apiRouter);
@@ -225,7 +225,7 @@ describe("Router", () => {
});
router.route("/test")
.get(async (ctx) => {
.get(async (_, ctx) => {
return new Response(ctx.state.test as string);
});