test: add TS checks and fix issues

This commit is contained in:
Pierre Martin
2024-03-10 10:49:36 +01:00
parent fd3783cc8d
commit 043051cb1c
14 changed files with 38 additions and 11 deletions

View File

@@ -1,5 +1,10 @@
import {
http,
HttpResponse,
HttpResponseResolver,
PathParams
} from "msw";
import { setupServer } from "msw/node";
import { http, HttpResponse, HttpResponseResolver, PathParams } from "msw";
import appsFixtures from "./apps.fixtures.json";
export const CAPROVER_TEST_DOMAIN = "caprover.test";
@@ -14,7 +19,7 @@ const withAuth = (resolver: HttpResponseResolver): HttpResponseResolver => {
headers.get("x-namespace") !== "captain" ||
headers.get("x-captain-auth") !== TEST_TOKEN
) {
return new HttpResponse("", { status: 401 });
return HttpResponse.json({}, { status: 401 });
}
return resolver(input);
};