deno.land / x / abc@v1.3.3 / router_test.ts

router_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { HandlerFunc } from "./types.ts";
import { assertEquals } from "./vendor/https/deno.land/std/testing/asserts.ts";import { createMockRequest } from "./test_util.ts";import { Router } from "./router.ts";import { Context } from "./context.ts";import { HttpMethod } from "./constants.ts";const { test } = Deno;
test("router basic", function (): void { const r = new Router(); const h: HandlerFunc = (c) => c.path; const c = new Context({ app: undefined!, r: createMockRequest({ url: "/get" }), }); r.add(HttpMethod.Get, "/get", h); assertEquals(r.find(HttpMethod.Get, c), h);});
abc

Version Info

Tagged at
2 years ago