feat(server): plugins can add middlewares and routes (#1455)
Co-authored-by: RoeHH <git@roeh.ch> Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
co-authored by
RoeHH
Marvin Hagemeister
parent
7dee138bee
commit
50db296fb7
@@ -53,6 +53,21 @@ Deno.test("/with-island prerender", async () => {
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("plugin routes and middleware", async () => {
|
||||
const resp = await router(new Request("https://fresh.deno.dev/test"));
|
||||
assert(resp);
|
||||
assertEquals(resp.status, Status.OK);
|
||||
const body = await resp.text();
|
||||
assertStringIncludes(
|
||||
body,
|
||||
`<h1>look, i'm set from a plugin!</h1>`,
|
||||
);
|
||||
assertStringIncludes(
|
||||
body,
|
||||
`<title>Title Set From Plugin Config</title>`,
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "/with-island hydration",
|
||||
async fn(t) {
|
||||
|
||||
Reference in New Issue
Block a user