From 915c5f2237e1d8a187249d187a7c7a1a12831ad6 Mon Sep 17 00:00:00 2001 From: sor4chi Date: Sun, 3 Dec 2023 12:02:41 +0900 Subject: [PATCH] test: add env injected basepath case --- packages/hono-do/tests/index.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/hono-do/tests/index.test.ts b/packages/hono-do/tests/index.test.ts index 08ef45c..172546c 100644 --- a/packages/hono-do/tests/index.test.ts +++ b/packages/hono-do/tests/index.test.ts @@ -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("/hoge", (app) => { + expectTypeOf(app).toEqualTypeOf< + Hono, "/hoge"> + >(); + }); + }); + it("should work with handler chain by flat way", async () => { const DO = generateHonoObject("/", () => {}); DO.alarm(async () => {});