chore: fix biome warnings/errors (#26295)
* Fix icon-names * make all errors into warns * Minimal fix to mock
This commit is contained in:
1 parent
e4753778fe
commit
c52eff65a2
14 files changed
+246
-217
No files matched your search
@@ -8,15 +8,18 @@ import { TRPCError } from "@trpc/server";
|
||||
|
||||
import { defaultResponderForAppDir } from "./defaultResponderForAppDir";
|
||||
|
||||
vi.mock("next/server", () => ({
|
||||
NextRequest: class MockNextRequest {},
|
||||
NextResponse: {
|
||||
json: vi.fn((body, init) => ({
|
||||
json: vi.fn().mockResolvedValue(body),
|
||||
status: init?.status || 200,
|
||||
})),
|
||||
},
|
||||
}));
|
||||
vi.mock("next/server", () => {
|
||||
class MockNextRequest extends Request {}
|
||||
return {
|
||||
NextRequest: MockNextRequest,
|
||||
NextResponse: {
|
||||
json: vi.fn((body, init) => ({
|
||||
json: vi.fn().mockResolvedValue(body),
|
||||
status: init?.status || 200,
|
||||
})),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
describe("defaultResponderForAppDir", () => {
|
||||
it("should return a JSON response when handler resolves with a result", async () => {
|
||||
@@ -44,7 +47,9 @@ describe("defaultResponderForAppDir", () => {
|
||||
});
|
||||
|
||||
it("should respond with status code 409 for NoAvailableUsersFound", async () => {
|
||||
const f = vi.fn().mockRejectedValue(new Error(ErrorCode.NoAvailableUsersFound));
|
||||
const f = vi
|
||||
.fn()
|
||||
.mockRejectedValue(new Error(ErrorCode.NoAvailableUsersFound));
|
||||
const req = { method: "GET", url: "/api/test" } as unknown as NextRequest;
|
||||
const params = Promise.resolve<Params>({});
|
||||
|
||||
@@ -60,7 +65,9 @@ describe("defaultResponderForAppDir", () => {
|
||||
});
|
||||
|
||||
it("should respond with a 429 status code for rate limit errors", async () => {
|
||||
const f = vi.fn().mockRejectedValue(new TRPCError({ code: "TOO_MANY_REQUESTS" }));
|
||||
const f = vi
|
||||
.fn()
|
||||
.mockRejectedValue(new TRPCError({ code: "TOO_MANY_REQUESTS" }));
|
||||
const req = { method: "POST", url: "/api/test" } as unknown as NextRequest;
|
||||
const params = Promise.resolve<Params>({});
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.26.10",
|
||||
"@biomejs/biome": "2.3.10",
|
||||
"@calcom/config": "workspace:*",
|
||||
"@calcom/types": "workspace:*",
|
||||
"@microsoft/microsoft-graph-types-beta": "0.15.0-preview",
|
||||
|
||||
Reference in new issue
Block a user