Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLeitwolf112026-09-28 01:47:38 +0300
committerLeitwolf112026-09-28 01:47:38 +0300
commit1045265e9ae018cb3d2d94a47d780888c26d04a2 (patch)
tree054208abc06df412ce3a660c20aa6e5c05ca65c9
parent136cc768d35354fbef7847d5f230a0d50308c248 (diff)
downloadwebsite-1045265e9ae018cb3d2d94a47d780888c26d04a2.tar.gz
Parse website links before checking hosts
-rw-r--r--frontend/tests/site-integrity.test.mjs8
1 files changed, 3 insertions, 5 deletions
diff --git a/frontend/tests/site-integrity.test.mjs b/frontend/tests/site-integrity.test.mjs
index 64c10c8..6da461d 100644
--- a/frontend/tests/site-integrity.test.mjs
+++ b/frontend/tests/site-integrity.test.mjs
@@ -218,11 +218,9 @@ test("every public link in the page shell uses the correct project identity", ()
const overview = read("src/pages/OverviewPage.vue");
const guide = read("src/pages/GettingStartedPage.vue");
const combined = [shell, home, overview, guide].join("\n");
- assert.ok(shell.includes("https://forum.xsharp-lang.xyz/"));
- const githubUrls = combined
- .split('"')
- .filter((value) => value.startsWith("https://github.com/"))
- .map((value) => new URL(value));
+ const parsedUrls = (combined.match(/https:\/\/[^"'\s<>]+/g) ?? []).map((value) => new URL(value));
+ assert.ok(parsedUrls.some((url) => url.hostname === "forum.xsharp-lang.xyz"));
+ const githubUrls = parsedUrls.filter((url) => url.hostname === "github.com");
const repositories = githubUrls.map((url) =>
url.pathname
.split("/")