Files
WRNexusJS/packages/dev-server/test/ui-css-hmr.test.ts
T
Clintchiz 2c960fc1dc
Quality / quality (ubuntu-latest) (push) Failing after 9m49s
Quality / quality (windows-latest) (push) Canceled after 0s
refactor: migrate legacy wire namespace to wrn
2026-08-12 18:51:15 +05:30

24 lines
708 B
TypeScript

import { expect, test } from "bun:test";
import { createDevAssetServer } from "../src/assets.ts";
test("UI CSS is read from its live source after an HMR change", async () => {
let css = ".wrn-card { color: red; }";
const assets = createDevAssetServer(
process.cwd(),
"development",
undefined,
undefined,
() => css,
);
const first = await assets.serve("/__wrnexus/ui.css");
expect(await first?.text()).toContain("color: red");
css = ".wrn-card { color: blue; }";
assets.invalidateCss();
const second = await assets.serve("/__wrnexus/ui.css");
expect(await second?.text()).toContain("color: blue");
expect(second?.headers.get("cache-control")).toBe("no-cache");
});