дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
* feat(website): add responsive homepage and Pages deployment * feat(website): add platform-specific installer download pages
17 рядки
763 B
JavaScript
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");
|
|
});
|