deno.land / x / opine@2.3.4 / test / units / app.listen.test.ts

app.listen.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
import opine from "../../mod.ts";import { describe, it } from "../utils.ts";
describe("app.listen()", () => { describe("when passing a port", () => { it("should wrap with an HTTP server", () => { const app = opine();
app.get("/deno", function (_req, res) { res.end("Hello Deno!"); });
const server = app.listen(9999); server.close(); }); });
describe("when passing an address", () => { it("should wrap with an HTTP server", () => { const app = opine();
app.get("/deno", function (_req, res) { res.end("Hello Deno!"); });
const server = app.listen("localhost:9999"); server.close(); }); });
describe("when passing an object", () => { it("should wrap with an HTTP server", () => { const app = opine();
app.get("/deno", function (_req, res) { res.end("Hello Deno!"); });
const server = app.listen({ port: 9999 }); server.close(); }); });});
opine

Version Info

Tagged at
2 years ago