Files
musistudio--claude-code-router/tests/main/web-client-bridge-html.test.mjs
T
wehub-resource-sync 9f48d4a18c
Docs / Build (push) Has been cancelled
Docs / Deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:37:25 +08:00

14 lines
677 B
JavaScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import path from "node:path";
import test from "node:test";
test("home renderer HTML loads the web client bridge before the app bundle", () => {
const projectRoot = process.cwd();
const buildConfig = readFileSync(path.join(projectRoot, "build", "esbuild.config.mjs"), "utf8");
const webBridge = readFileSync(path.join(projectRoot, "packages", "ui", "src", "web-client-bridge.ts"), "utf8");
assert.match(buildConfig, /beforeModuleScriptTags:\s*\[\s*' <script src="\.\.\/\.\.\/assets\/web-client-bridge\.js"><\/script>'\s*\]/);
assert.match(webBridge, /if \(!window\.ccr\) \{/);
});