From b549766709feb10d9fc4121aee94b67e35a60ab2 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:51:02 +0800 Subject: [PATCH] feat(ci): url records should not reference themselves --- tests/records.test.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/records.test.js b/tests/records.test.js index f6cd66d5e..90011493e 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -220,6 +220,26 @@ t("All files should have valid record values", (t) => { if (key === "URL") { t.notThrows(() => new URL(value), `${file}: Record value should be a valid URL for ${key}`); + + if(file === "@.json") { + t.false( + value === "http://is-a.dev", + `${file}: Record value should not reference itself for ${key}` + ); + t.false( + value === "https://is-a.dev", + `${file}: Record value should not reference itself for ${key}` + ); + } else { + t.false( + value === "http://" + file.replace(/\.json$/, "") + ".is-a.dev", + `${file}: Record value should not reference itself for ${key}` + ); + t.false( + value === "https://" + file.replace(/\.json$/, "") + ".is-a.dev", + `${file}: Record value should not reference itself for ${key}` + ); + } } }