mirror of
https://github.com/certd/certd.git
synced 2026-06-11 03:17:31 +08:00
17 lines
540 B
TypeScript
Executable File
17 lines
540 B
TypeScript
Executable File
import { createHttpRequest } from "@midwayjs/mock";
|
|
import { Application } from "@midwayjs/koa";
|
|
import assert from "assert";
|
|
import { getApp } from "../setup.js";
|
|
|
|
describe("test/controller/home.test.ts", () => {
|
|
it("should POST /api/get_user", async function (this: any) {
|
|
const app: Application = getApp();
|
|
// make request
|
|
const result = await createHttpRequest(app).get("/api/get_user").query({ uid: 123 });
|
|
|
|
// use expect by jest
|
|
assert(result.status === 200);
|
|
assert(result.body.message === "OK");
|
|
});
|
|
});
|