11 lines
456 B
TypeScript
11 lines
456 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { HMR_CLIENT_JS } from "../src/runtime.ts";
|
|
|
|
test("HMR client syncs fresh HTML over the websocket", () => {
|
|
expect(HMR_CLIENT_JS).toContain('send({ type: "sync"');
|
|
expect(HMR_CLIENT_JS).toContain('msg.type === "html"');
|
|
expect(HMR_CLIENT_JS).toContain("applyHtml(msg.html)");
|
|
expect(HMR_CLIENT_JS).not.toContain("fetch(location.href");
|
|
expect(HMR_CLIENT_JS).not.toContain("location.reload()");
|
|
});
|