refactor: ♻️ Use native Hono return functions instead of custom ones

This commit is contained in:
Jesse Wierzbinski 2024-08-19 21:03:59 +02:00 committed by April John
parent 1a8e063f87
commit a601bc856e
105 changed files with 639 additions and 581 deletions

View file

@ -48,7 +48,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -75,7 +75,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -129,7 +129,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -160,7 +160,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -183,7 +183,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
const body = (await response.json()) as ApiAccount[];
@ -214,7 +214,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -245,7 +245,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -276,7 +276,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -307,7 +307,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -336,7 +336,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -371,7 +371,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -397,7 +397,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -428,7 +428,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
});
@ -450,7 +450,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);

View file

@ -43,7 +43,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(202);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -76,7 +76,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -123,7 +123,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -168,7 +168,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -218,7 +218,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -248,7 +248,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -276,7 +276,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -308,7 +308,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);
@ -365,7 +365,7 @@ describe("API Tests", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(
expect(response.headers.get("content-type")).toContain(
"application/json",
);

View file

@ -47,7 +47,9 @@ describe("POST /api/v1/apps/", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe("application/json");
expect(response.headers.get("content-type")).toContain(
"application/json",
);
const json = await response.json();
@ -149,7 +151,9 @@ describe("POST /oauth/token/", () => {
const json = await response.json();
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe("application/json");
expect(response.headers.get("content-type")).toContain(
"application/json",
);
expect(json).toEqual({
access_token: expect.any(String),
token_type: "Bearer",
@ -178,7 +182,9 @@ describe("GET /api/v1/apps/verify_credentials", () => {
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe("application/json");
expect(response.headers.get("content-type")).toContain(
"application/json",
);
const credentials = (await response.json()) as Partial<ApiApplication>;