added readOneBy, updateMany, deleteMany, exists

This commit is contained in:
dswbx
2025-03-05 08:02:57 +01:00
parent 4f52537ea0
commit ef629321ab
9 changed files with 299 additions and 16 deletions

View File

@@ -89,6 +89,14 @@ describe("ModuleApi", () => {
expect(api.delete("/").request.method).toEqual("DELETE");
});
it("refines", async () => {
const app = new Hono().get("/endpoint", (c) => c.json({ foo: ["bar"] }));
const api = new Api({ host }, app.request as typeof fetch);
expect((await api.get("/endpoint")).data).toEqual({ foo: ["bar"] });
expect((await api.get("/endpoint").refine((data) => data.foo)).data).toEqual(["bar"]);
});
// @todo: test error response
// @todo: test method shortcut functions
});