import assert from "node:assert/strict"; import test from "node:test"; async function render() { const workerUrl = new URL("../dist/server/index.js", import.meta.url); workerUrl.searchParams.set("test", `${process.pid}-${Date.now()}`); const { default: worker } = await import(workerUrl.href); return worker.fetch( new Request("http://localhost/", { headers: { accept: "text/html" } }), { ASSETS: { fetch: async () => new Response("Not found", { status: 404 }) }, }, { waitUntil() {}, passThroughOnException() {} }, ); } test("server-renders the ReMe Studio shell", async () => { const response = await render(); assert.equal(response.status, 200); assert.match(response.headers.get("content-type") ?? "", /^text\/html\b/i); const html = await response.text(); assert.match(html, /ReMe Studio<\/title>/i); assert.match(html, /新建 Agent 对话/); assert.match(html, /文件保留在你的本地工作区/); assert.doesNotMatch( html, /codex-preview|Your site is taking shape|react-loading-skeleton/i, ); });