fix: route param fallback not empty string (#2146)

This commit is contained in:
Marvin Hagemeister
2023-12-06 09:33:36 +01:00
committed by GitHub
parent c05a6b1496
commit c72f534369
4 changed files with 20 additions and 3 deletions
+8
View File
@@ -1212,3 +1212,11 @@ Deno.test("Expose config in ctx", async () => {
});
});
});
Deno.test("empty string fallback for optional params", async () => {
await withFakeServe("./tests/fixture/main.ts", async (server) => {
const doc = await server.getHtml(`/std/foo`);
const data = JSON.parse(doc.querySelector("pre")?.textContent!);
assertEquals(data, { path: "foo", version: "" });
});
});