fix: switch to websockets for development server (#1943)

This commit is contained in:
Marvin Hagemeister
2023-10-16 07:44:27 +02:00
committed by GitHub
parent c3938dc703
commit 86a96eeee4
5 changed files with 111 additions and 79 deletions
-22
View File
@@ -66,20 +66,6 @@ Deno.test({
},
});
Deno.test("adds refresh script to html", async () => {
await withFakeServe("./tests/fixture/dev.ts", async (server) => {
const doc = await server.getHtml("/");
assertSelector(doc, `script[src="/_frsh/refresh.js"]`);
const res = await server.get(`/_frsh/refresh.js`);
assertEquals(
res.headers.get("content-type"),
"application/javascript; charset=utf-8",
);
await res.body?.cancel();
});
});
Deno.test("preact/debug is active in dev mode", async () => {
await withFakeServe(
"./tests/fixture_render_error/dev.ts",
@@ -99,14 +85,6 @@ Deno.test("preact/debug is active in dev mode", async () => {
);
});
Deno.test("middleware destination internal", async () => {
await withFakeServe("./tests/fixture/dev.ts", async (server) => {
const resp = await server.get(`/_frsh/refresh.js`);
assertEquals(resp.headers.get("destination"), "internal");
await resp.body?.cancel();
});
});
Deno.test("warns when using hooks in server components", async (t) => {
await withFakeServe("./tests/fixture/main.ts", async (server) => {
await t.step("useState", async () => {