feat: add support for jsx precompile (#2035)

This commit is contained in:
Marvin Hagemeister
2023-11-13 12:06:55 +01:00
committed by GitHub
parent de631c3140
commit 0961e775db
11 changed files with 101 additions and 2 deletions
+22
View File
@@ -55,3 +55,25 @@ Deno.test("render head text nodes", async () => {
assertEquals(doc.body.textContent, "hello");
});
});
Deno.test("support jsx precompile", async () => {
await withFakeServe(
"./tests/fixture_jsx_precompile/main.ts",
async (server) => {
const doc = await server.getHtml("/");
assertTextMany(doc, "h1", ["Hello World"]);
assertTextMany(doc, ".island", ["it works"]);
},
);
});
Deno.test("support <Head /> with jsx precompile", async () => {
await withFakeServe(
"./tests/fixture_jsx_precompile/main.ts",
async (server) => {
const doc = await server.getHtml("/head");
assertTextMany(doc, "h1", ["Hello World"]);
assertTextMany(doc, "head title", ["foo"]);
},
);
});