fix: support legacy and beta prerelease version formats

This commit is contained in:
Peter Steinberger
2026-02-24 02:05:29 +00:00
parent 08e2aa44e7
commit 6c441ea797
8 changed files with 152 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { isBetaTag, isStableTag } from "./update-channels.js";
describe("update-channels tag detection", () => {
it("recognizes both -beta and .beta formats", () => {
expect(isBetaTag("v2026.2.24-beta.1")).toBe(true);
expect(isBetaTag("v2026.2.24.beta.1")).toBe(true);
});
it("keeps legacy -x tags stable", () => {
expect(isBetaTag("v2026.2.24-1")).toBe(false);
expect(isStableTag("v2026.2.24-1")).toBe(true);
});
it("does not false-positive on non-beta words", () => {
expect(isBetaTag("v2026.2.24-alphabeta.1")).toBe(false);
expect(isStableTag("v2026.2.24")).toBe(true);
});
});