verifyRemoteSshTarget.test.ts 922 B

12345678910111213141516171819
  1. import { describe, expect, it } from "vitest";
  2. import { dockerPlatformForTarget, resolveVerificationTarget } from "../scripts/verify-remote-ssh-target.mjs";
  3. describe("remote SSH verification target", () => {
  4. it("follows the host architecture when no target is provided", () => {
  5. expect(resolveVerificationTarget(undefined, "x64")).toBe("linux-x64");
  6. expect(resolveVerificationTarget(undefined, "arm64")).toBe("linux-arm64");
  7. });
  8. it("rejects unsupported host and Darwin targets", () => {
  9. expect(() => resolveVerificationTarget(undefined, "ia32")).toThrow(/Unsupported host architecture/);
  10. expect(() => resolveVerificationTarget("darwin-arm64", "arm64")).toThrow(/Linux target/);
  11. });
  12. it("maps a release target to its Docker platform", () => {
  13. expect(dockerPlatformForTarget("linux-x64")).toBe("linux/amd64");
  14. expect(dockerPlatformForTarget("linux-arm64")).toBe("linux/arm64");
  15. });
  16. });