Skip to content

Commit

Permalink
test update
Browse files Browse the repository at this point in the history
  • Loading branch information
Octo8080X committed Jan 2, 2024
1 parent 58a5196 commit 6f4a65b
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions tests/test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { createHandler, ServeHandlerInfo } from "$fresh/server.ts";
import manifest from "./work/fresh.gen.ts";
import config, { connectionPool } from "./config/test_fresh.config.ts";
import config from "./config/test_fresh.config.ts";
import { expect } from "./test_deps.ts";

const CONN_INFO: ServeHandlerInfo = {
remoteAddr: { hostname: "127.0.0.1", port: 53496, transport: "tcp" },
};

Deno.test("Response Test", async (t) => {
// const handler = await createHandler(manifest, config);

await t.step("No login => Redirect", async () => {
const handler = await createHandler(manifest, config);
let resp = await handler(
Expand Down Expand Up @@ -44,31 +42,6 @@ Deno.test("Response Test", async (t) => {
const text = await resp.text();
expect(text.includes('href="/user/login"')).toBe(true);
});
//
//
// await t.step("Not Work Session(incorrect cookie)", async () => {
// let resp = await handler(
// new Request("http://127.0.0.1/session"),
// CONN_INFO,
// );
// assertEquals(resp.status, 200);
//
// let text = await resp.text();
// assertEquals(text.includes("<p>count:0</p>"), true);
//
// const sessionKey =
// (resp.headers.get("set-cookie")!).split("session=")[1].split(";")[0];
//
// resp = await handler(
// new Request("http://127.0.0.1/session", {
// headers: { cookie: `session=${sessionKey}AA` },
// }),
// CONN_INFO,
// );
// assertEquals(resp.status, 200);
// text = await resp.text();
// assertEquals(text.includes("<p>count:0</p>"), true);
// });
});

await Deno.test(
Expand Down

0 comments on commit 6f4a65b

Please sign in to comment.