diff options
| author | Leitwolf11 | 2026-09-28 01:47:38 +0300 |
|---|---|---|
| committer | Leitwolf11 | 2026-09-28 01:47:38 +0300 |
| commit | 1045265e9ae018cb3d2d94a47d780888c26d04a2 (patch) | |
| tree | 054208abc06df412ce3a660c20aa6e5c05ca65c9 | |
| parent | 136cc768d35354fbef7847d5f230a0d50308c248 (diff) | |
| download | website-1045265e9ae018cb3d2d94a47d780888c26d04a2.tar.gz | |
Parse website links before checking hosts
| -rw-r--r-- | frontend/tests/site-integrity.test.mjs | 8 |
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("/") |