From e0ceda2ccca0de32830f199f995bfa87a3033264 Mon Sep 17 00:00:00 2001 From: Etienne Lescot Date: Sat, 8 Aug 2026 23:31:57 +0200 Subject: [PATCH] test(ci): cover the missing-tag path under STRICT The strict set exercised three of the four bail() paths; STABLE_TAG was the one left dark. --- .github/scripts/discord-release-announce.test.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/scripts/discord-release-announce.test.mjs b/.github/scripts/discord-release-announce.test.mjs index 1381c480b..6faa10d9e 100644 --- a/.github/scripts/discord-release-announce.test.mjs +++ b/.github/scripts/discord-release-announce.test.mjs @@ -199,6 +199,15 @@ describe("strict mode", () => { const STRICT_ENV = { ...BASE_ENV, STRICT: "1", DISCORD_RELEASE_CHANNEL_ID: "123" }; const exits1 = /process\.exit unexpectedly called with "1"/; + it("fails when the release tag is missing", async () => { + await expect( + loadScript({ ...BASE_ENV, STABLE_TAG: "", STRICT: "1", DISCORD_RELEASE_CHANNEL_ID: "123" }), + ).rejects.toThrow(exits1); + expect(vi.mocked(setFailed)).toHaveBeenCalledWith( + expect.stringContaining("STABLE_TAG missing"), + ); + }); + it("fails when the Discord configuration is missing", async () => { await expect(loadScript({ STABLE_TAG: "v1.5.0", STRICT: "1" })).rejects.toThrow(exits1); expect(vi.mocked(setFailed)).toHaveBeenCalledWith(expect.stringContaining("DISCORD_BOT_TOKEN"));