fixes handlers not being compatible with deno handlers
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user