Skip to content

Commit

Permalink
test: add env injected basepath case
Browse files Browse the repository at this point in the history
  • Loading branch information
sor4chi committed Dec 3, 2023
1 parent 7661f40 commit 2dc3cdc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/hono-do/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ describe("generateHonoObject", () => {
});
});

it("should work with type-safe base path, with empty path", async () => {
type AppEnv = {
Bindings: {
HOGE_DB: D1Database;
};
};

generateHonoObject<AppEnv>("/hoge", (app) => {
expectTypeOf(app).toEqualTypeOf<
Hono<AppEnv, Record<string, never>, "/hoge">
>();
});
});

it("should work with handler chain by flat way", async () => {
const DO = generateHonoObject("/", () => {});
DO.alarm(async () => {});
Expand Down

0 comments on commit 2dc3cdc

Please sign in to comment.