Files
certd/packages/ui/certd-server/test/controller/home.test.ts
T

17 lines
485 B
TypeScript
Raw Normal View History

2026-05-31 01:41:33 +08:00
import { createHttpRequest } from "@midwayjs/mock";
import { Application } from "@midwayjs/koa";
import assert from "assert";
import { getApp } from "../setup.js";
2023-01-29 13:44:19 +08:00
2026-05-31 01:41:33 +08:00
describe("test/controller/home.test.ts", () => {
it("should GET /", async () => {
2024-07-15 00:30:33 +08:00
const app: Application = getApp();
2023-01-29 13:44:19 +08:00
// make request
2026-05-31 01:41:33 +08:00
const result = await createHttpRequest(app).get("/");
2023-01-29 13:44:19 +08:00
// use expect by jest
2024-07-15 00:30:33 +08:00
assert(result.status === 200);
2026-05-31 01:41:33 +08:00
assert(result.text === "Hello Midwayjs!");
2023-01-29 13:44:19 +08:00
});
});