deno.land / x / opine@2.3.4 / examples / location / 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
import { superdeno } from "../../test/deps.ts";import { describe, it } from "../../test/utils.ts";import { app } from "./index.ts";
describe("location", () => { it("should respond with 'Hello Deno!' on the /home path", (done) => { superdeno(app) .get("/home") .expect(200, "Hello Deno!", done); });
it("should redirect to the /home path from /redirect", (done) => { superdeno(app) .get("/redirect") .expect("Location", "/home") .expect(301, done); });
it("should respond with 'Hello Deno!' on the /redirect path once redirected", (done) => { superdeno(app) .get("/redirect") .redirects(1) .expect(200, "Hello Deno!", done); });});
opine

Version Info

Tagged at
2 years ago