Files
gunshiz be095ab236
CI / Verify (push) Successful in 1m8s
CI / Build immutable images and deploy (push) Has been skipped
feat(deploy): notify clients of new releases
2026-08-29 07:13:04 +00:00

21 lines
721 B
TypeScript

import { describe, expect, it } from "vitest";
import {
hasDeploymentChanged,
normalizeDeploymentId,
} from "./version";
describe("deployment version comparison", () => {
it("normalizes identifiers before comparing them", () => {
expect(normalizeDeploymentId(" release-2 ")).toBe("release-2");
expect(normalizeDeploymentId(" ")).toBeNull();
expect(hasDeploymentChanged("release-1", " release-2 ")).toBe(true);
});
it("does not announce the initial or unchanged deployment", () => {
expect(hasDeploymentChanged(null, "release-2")).toBe(false);
expect(hasDeploymentChanged("release-2", "release-2")).toBe(false);
expect(hasDeploymentChanged("release-2", "")).toBe(false);
});
});