release: WRNexusJS 0.7.0
This commit is contained in:
@@ -73,3 +73,20 @@ test("collectScripts omits client navigation in document mode", () => {
|
||||
|
||||
expect(scripts).not.toContain("/__wrnexus/nav.js");
|
||||
});
|
||||
|
||||
test("collectScripts ships zero framework JavaScript for static markup by default", () => {
|
||||
expect(collectScripts('<main><a href="/about">About</a></main>')).toEqual([]);
|
||||
});
|
||||
|
||||
test("collectScripts adds navigation in explicit client mode", () => {
|
||||
expect(collectScripts("<main>Server rendered</main>", [], { mode: "client" })).toEqual([
|
||||
"/__wrnexus/nav.js",
|
||||
]);
|
||||
});
|
||||
|
||||
test("collectScripts auto-adds navigation when a page already needs a browser runtime", () => {
|
||||
expect(collectScripts('<button data-scope="{}">Count</button>')).toEqual([
|
||||
"/__wrnexus/nav.js",
|
||||
"/__wrnexus/reactive.js",
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user