release: WRNexusJS 0.8.0
Quality / quality (ubuntu-latest) (push) Failing after 21s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-02 23:18:51 +05:30
parent 87507edf59
commit 586a6db8ff
625 changed files with 243608 additions and 11210 deletions
@@ -1,5 +1,5 @@
import { expect, test } from "bun:test";
import { PWA_CLIENT, usesMobileRuntime } from "../src/runtime.ts";
import { PWA_CLIENT, PWA_DEV_CLEANUP_CLIENT, usesMobileRuntime } from "../src/runtime.ts";
test("PWA registration is valid JavaScript and Trusted Types compatible", () => {
expect(() => new Bun.Transpiler({ loader: "js" }).transformSync(PWA_CLIENT)).not.toThrow();
@@ -7,6 +7,14 @@ test("PWA registration is valid JavaScript and Trusted Types compatible", () =>
expect(PWA_CLIENT).toContain("createScriptURL(swUrl)");
});
test("development PWA cleanup removes stale WRNexus service workers and caches", () => {
expect(() =>
new Bun.Transpiler({ loader: "js" }).transformSync(PWA_DEV_CLEANUP_CLIENT),
).not.toThrow();
expect(PWA_DEV_CLEANUP_CLIENT).toContain("registration.unregister()");
expect(PWA_DEV_CLEANUP_CLIENT).toContain("wrnexus-pwa-");
});
test("mobile runtime is shipped only for pages using mobile or native directives", () => {
expect(usesMobileRuntime('<main class="page">Docs</main>')).toBe(false);
expect(usesMobileRuntime('<button data-native-mobile="share">Share</button>')).toBe(true);