added format command and added trailing commas to reduce conflicts

This commit is contained in:
dswbx
2025-02-26 20:06:03 +01:00
parent 88b5359f1c
commit 7743f71a11
414 changed files with 3622 additions and 3610 deletions

View File

@@ -19,8 +19,8 @@ describe("Api", async () => {
const token = await sign({ foo: "bar" }, "1234");
const request = new Request("http://example.com/test", {
headers: {
Authorization: `Bearer ${token}`
}
Authorization: `Bearer ${token}`,
},
});
const api = new Api({ request });
expect(api.isAuthVerified()).toBe(false);
@@ -35,8 +35,8 @@ describe("Api", async () => {
const token = await sign({ foo: "bar" }, "1234");
const request = new Request("http://example.com/test", {
headers: {
Cookie: `auth=${token}`
}
Cookie: `auth=${token}`,
},
});
const api = new Api({ request });
expect(api.isAuthVerified()).toBe(false);

View File

@@ -26,7 +26,7 @@ describe("DataApi", () => {
it("returns result", async () => {
const schema = proto.em({
posts: proto.entity("posts", { title: proto.text() })
posts: proto.entity("posts", { title: proto.text() }),
});
const em = schemaToEm(schema);
await em.schema().sync({ force: true });
@@ -60,7 +60,7 @@ describe("DataApi", () => {
select: ["title"],
limit: 100000,
offset: 0,
sort: "id"
sort: "id",
});
expect(req.request.method).toBe("POST");
const res = await req;

View File

@@ -18,8 +18,8 @@ const mockedBackend = new Hono()
return new Response(file, {
headers: {
"Content-Type": file.type,
"Content-Length": file.size.toString()
}
"Content-Length": file.size.toString(),
},
});
});
@@ -30,7 +30,7 @@ describe("MediaApi", () => {
// @ts-ignore tests
const api = new MediaApi({
host,
basepath
basepath,
});
expect(api.getFileUploadUrl({ path: "path" })).toBe(`${host}${basepath}/upload/path`);
});
@@ -38,7 +38,7 @@ describe("MediaApi", () => {
it("should have correct upload headers", () => {
// @ts-ignore tests
const api = new MediaApi({
token: "token"
token: "token",
});
expect(api.getUploadHeaders().get("Authorization")).toBe("Bearer token");
});
@@ -139,7 +139,7 @@ describe("MediaApi", () => {
const response = (await mockedBackend.request(url)) as Response;
await matches(
await api.upload(response.body!, { filename: "readable.png" }),
"readable.png"
"readable.png",
);
}
});

View File

@@ -61,7 +61,7 @@ describe("ModuleApi", () => {
it("adds additional headers from options", () => {
const headers = new Headers({
"X-Test": "123"
"X-Test": "123",
});
const api = new Api({ host, headers });
expect(api.get("/").request.headers.get("X-Test")).toEqual("123");
@@ -75,7 +75,7 @@ describe("ModuleApi", () => {
it("uses search params", () => {
const api = new Api({ host });
const search = new URLSearchParams({
foo: "bar"
foo: "bar",
});
expect(api.get("/", search).request.url).toEqual("http://localhost/?" + search.toString());
});