import { describe, expect, it } from "@suaveplan/testing/runner"; import { CDN_SERVICE_NAME, DEFAULT_AUTH_URL, DEFAULT_REGION, DEFAULT_RETRY_BASE_DELAY_MS, DEFAULT_RETRY_MAX_ATTEMPTS, DEFAULT_RETRY_MAX_DELAY_MS, MAX_KEY_LENGTH, RACKSPACE_REGIONS, RETRY_AFTER_MAX_DELAY_MS, STORAGE_SERVICE_NAME, TOKEN_REFRESH_LEAD_MS, TRANSIENT_HTTP_STATUSES, } from "./constants.js"; describe("constants", () => { it("expose the documented defaults", { timeout: 5000 }, () => { expect(DEFAULT_AUTH_URL).toContain("identity.api.rackspacecloud.com"); expect(DEFAULT_REGION).toBe("LON"); expect(STORAGE_SERVICE_NAME).toBe("cloudFiles"); expect(CDN_SERVICE_NAME).toBe("cloudFilesCDN"); expect(RACKSPACE_REGIONS).toContain("LON"); expect(TOKEN_REFRESH_LEAD_MS).toBe(5 * 60 * 1000); expect(MAX_KEY_LENGTH).toBe(2048); expect(DEFAULT_RETRY_MAX_ATTEMPTS).toBeGreaterThan(0); expect(DEFAULT_RETRY_BASE_DELAY_MS).toBeGreaterThan(0); expect(DEFAULT_RETRY_MAX_DELAY_MS).toBeGreaterThan( DEFAULT_RETRY_BASE_DELAY_MS ); expect(RETRY_AFTER_MAX_DELAY_MS).toBe(60_000); expect(TRANSIENT_HTTP_STATUSES.has(429)).toBe(true); }); });