mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-10-03 02:24:31 +00:00
* feat(studio): align branding with documentation site * fix(studio): refine brand lockups * fix(studio): simplify welcome branding * docs(studio): add comprehensive visual guide * docs: promote Studio to top-level navigation * fix(studio): address review feedback
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
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();
|
|
const packageJson = JSON.parse(
|
|
await readFile(new URL("../package.json", import.meta.url), "utf8"),
|
|
);
|
|
assert.match(html, /<title>ReMe Studio<\/title>/i);
|
|
assert.match(
|
|
html.replaceAll("<!-- -->", ""),
|
|
new RegExp(`v${packageJson.version}`),
|
|
);
|
|
assert.match(html, /新建 Agent 对话/);
|
|
assert.match(html, /文件保留在你的本地工作区/);
|
|
assert.doesNotMatch(
|
|
html,
|
|
/codex-preview|Your site is taking shape|react-loading-skeleton/i,
|
|
);
|
|
});
|