feat: allow plugins to modify HTML body (#2022)
Based on https://github.com/denoland/fresh/pull/1769 . Mostly added a test. --------- Co-authored-by: Adam Gregory <adam@aguilaengineering.com>
This commit is contained in:
co-authored by
Adam Gregory
parent
14cecc0a6f
commit
7ff2781fcd
@@ -14,6 +14,7 @@ import {
|
||||
clickWhenListenerReady,
|
||||
runBuild,
|
||||
startFreshServer,
|
||||
withFakeServe,
|
||||
withPageName,
|
||||
} from "./test_utils.ts";
|
||||
|
||||
@@ -181,3 +182,14 @@ Deno.test("plugin script doesn't halt island execution", async () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test("supports returning htmlText", async () => {
|
||||
await withFakeServe(
|
||||
"./tests/fixture_plugin_html/main.ts",
|
||||
async (server) => {
|
||||
const doc = await server.getHtml("/");
|
||||
assertEquals(doc.body.textContent, "it works");
|
||||
},
|
||||
{ loadConfig: true },
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user