Files
WRNexusJS/packages/compiler/test/client-render.test.ts
T
Clintchiz 586a6db8ff
Quality / quality (ubuntu-latest) (push) Failing after 21s
Quality / quality (windows-latest) (push) Canceled after 0s
release: WRNexusJS 0.8.0
2026-08-02 23:18:51 +05:30

12 lines
500 B
TypeScript

import { expect, test } from "bun:test";
import { generate, parse } from "../src/index.ts";
test("client-rendered pages emit an inert template and browser mount anchor", () => {
const code = generate(
parse('page ClientOnly { render = "client" view { <main><h1>Browser only</h1></main> } }'),
);
expect(code).toContain('data-wrn-client-root="');
expect(code).toContain('data-wrn-client-template="');
expect(code.indexOf("Browser only")).toBeGreaterThan(code.indexOf("<template"));
});