Файли
openidea/website/tests/paths.test.mjs
T
Jaw bb508d4118 feat(website): add responsive homepage and GitHub Pages deployment (#277)
* feat(website): add responsive homepage and Pages deployment

* feat(website): add platform-specific installer download pages
2026-11-07 01:17:04 +08:00

17 рядки
763 B
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { normalizeBasePath, publicAsset } from "../src/lib/paths.mjs";
test("normalizes both repository Pages and custom-domain roots", () => {
assert.equal(normalizeBasePath(), "/");
assert.equal(normalizeBasePath(""), "/");
assert.equal(normalizeBasePath("/openidea"), "/openidea/");
assert.equal(normalizeBasePath("/openidea/"), "/openidea/");
});
test("keeps public media under the deployed repository prefix", () => {
assert.equal(publicAsset("media/debug.jpg", "/openidea/"), "/openidea/media/debug.jpg");
assert.equal(publicAsset("/media/debug.jpg", "/openidea"), "/openidea/media/debug.jpg");
assert.equal(publicAsset("media/debug.jpg", "/"), "/media/debug.jpg");
});