deno.land / x / opine@2.3.4 / examples / multi-router / index.test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { superdeno } from "../../test/deps.ts";import { describe, it } from "../../test/utils.ts";import { app } from "./index.ts";
describe("multi-router", () => { describe("GET /", function () { it("should respond with root handler", function (done) { superdeno(app) .get("/") .expect(200, "Hello from root route.", done); }); });
describe("GET /api/v1/", function () { it("should respond with APIv1 root handler", function (done) { superdeno(app) .get("/api/v1/") .expect(200, "Hello from APIv1 root route.", done); }); });
describe("GET /api/v1/users", function () { it("should respond with users from APIv1", function (done) { superdeno(app) .get("/api/v1/users") .expect(200, "List of APIv1 users.", done); }); });
describe("GET /api/v2/", function () { it("should respond with APIv2 root handler", function (done) { superdeno(app) .get("/api/v2/") .expect(200, "Hello from APIv2 root route.", done); }); });
describe("GET /api/v2/users", function () { it("should respond with users from APIv2", function (done) { superdeno(app) .get("/api/v2/users") .expect(200, "List of APIv2 users.", done); }); });});
opine

Version Info

Tagged at
2 years ago