fix: refresh not working (#1659)

This commit is contained in:
Marvin Hagemeister
2023-08-17 11:46:07 +02:00
committed by GitHub
parent 8f285e41a7
commit b2548b24cd
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -90,6 +90,9 @@ export function renderOuterDocument(
opts.preloads.map((src) =>
h("link", { rel: "modulepreload", href: src })
),
opts.moduleScripts.map(([src, nonce]) =>
h("script", { src: src, nonce, type: "module" })
),
headVNodes,
h("body", {
...docBody,
+7
View File
@@ -971,3 +971,10 @@ Deno.test({
sanitizeOps: false,
sanitizeResources: false,
});
Deno.test("adds refresh script to html", async () => {
await withFresh("./tests/fixture/main.ts", async (address) => {
const doc = await fetchHtml(address);
assertSelector(doc, `script[src="/_frsh/refresh.js"]`);
});
});