|
1 | 1 | import { createHandler, ServeHandlerInfo } from "$fresh/server.ts"; |
2 | 2 | import manifest from "./work/fresh.gen.ts"; |
3 | | -import config, { connectionPool } from "./config/test_fresh.config.ts"; |
| 3 | +import config from "./config/test_fresh.config.ts"; |
4 | 4 | import { expect } from "./test_deps.ts"; |
5 | 5 |
|
6 | 6 | const CONN_INFO: ServeHandlerInfo = { |
7 | 7 | remoteAddr: { hostname: "127.0.0.1", port: 53496, transport: "tcp" }, |
8 | 8 | }; |
9 | 9 |
|
10 | 10 | Deno.test("Response Test", async (t) => { |
11 | | - // const handler = await createHandler(manifest, config); |
12 | | - |
13 | 11 | await t.step("No login => Redirect", async () => { |
14 | 12 | const handler = await createHandler(manifest, config); |
15 | 13 | let resp = await handler( |
@@ -44,31 +42,6 @@ Deno.test("Response Test", async (t) => { |
44 | 42 | const text = await resp.text(); |
45 | 43 | expect(text.includes('href="/user/login"')).toBe(true); |
46 | 44 | }); |
47 | | - // |
48 | | - // |
49 | | - // await t.step("Not Work Session(incorrect cookie)", async () => { |
50 | | - // let resp = await handler( |
51 | | - // new Request("http://127.0.0.1/session"), |
52 | | - // CONN_INFO, |
53 | | - // ); |
54 | | - // assertEquals(resp.status, 200); |
55 | | - // |
56 | | - // let text = await resp.text(); |
57 | | - // assertEquals(text.includes("<p>count:0</p>"), true); |
58 | | - // |
59 | | - // const sessionKey = |
60 | | - // (resp.headers.get("set-cookie")!).split("session=")[1].split(";")[0]; |
61 | | - // |
62 | | - // resp = await handler( |
63 | | - // new Request("http://127.0.0.1/session", { |
64 | | - // headers: { cookie: `session=${sessionKey}AA` }, |
65 | | - // }), |
66 | | - // CONN_INFO, |
67 | | - // ); |
68 | | - // assertEquals(resp.status, 200); |
69 | | - // text = await resp.text(); |
70 | | - // assertEquals(text.includes("<p>count:0</p>"), true); |
71 | | - // }); |
72 | 45 | }); |
73 | 46 |
|
74 | 47 | await Deno.test( |
|
0 commit comments