deno.land / x / opine@2.3.4 / test / units / req.route.test.ts

req.route.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
import { opine } from "../../mod.ts";import { expect, superdeno } from "../deps.ts";import { describe, it } from "../utils.ts";
describe("req", function () { describe(".route", function () { it("should be the executed Route", function (done) { const app = opine();
app.get("/user/:id/:op?", function (req, res, next) { expect(req.route.path).toEqual("/user/:id/:op?"); next(); });
app.get("/user/:id/edit", function (req, res) { expect(req.route.path).toEqual("/user/:id/edit"); res.end(); });
superdeno(app) .get("/user/12/edit") .expect(200, done); }); });});
opine

Version Info

Tagged at
a year ago