Files
outline/server/routes/api/index.test.ts
Tom Moor c85f3bd7b4 fix: Remove ability to use GET for RPC API requests by default (#4042)
* fix: Remove ability to use GET for RPC API requests by default

* tsc
2022-09-02 01:05:40 -07:00

27 lines
666 B
TypeScript

import { getTestServer } from "@server/test/support";
const server = getTestServer();
afterAll(server.disconnect);
describe("POST unknown endpoint", () => {
it("should be not found", async () => {
const res = await server.post("/api/blah");
expect(res.status).toEqual(404);
});
});
describe("GET unknown endpoint", () => {
it("should be not found", async () => {
const res = await server.get("/api/blah");
expect(res.status).toEqual(404);
});
});
describe("PATCH unknown endpoint", () => {
it("should be method not allowed", async () => {
const res = await server.patch("/api/blah");
expect(res.status).toEqual(405);
});
});