import assert from "node:assert/strict"; import { test } from "node:test"; import { checkRuntimeConfig } from "../lib/config"; test("requires secure production secrets and a public HTTPS origin", () => { assert.equal(checkRuntimeConfig({ NODE_ENV: "production", SESSION_SECRET: "x".repeat(32), TOKEN_ENCRYPTION_KEY: "a".repeat(64), NEXT_PUBLIC_APP_URL: "https://hub.example.test" }).ok, true); const invalid = checkRuntimeConfig({ NODE_ENV: "production", SESSION_SECRET: "development-only-change-me", TOKEN_ENCRYPTION_KEY: "wrong", NEXT_PUBLIC_APP_URL: "http://localhost:8088" }); assert.equal(invalid.ok, false); assert.equal(invalid.errors.length, 3); assert.equal(checkRuntimeConfig({ NODE_ENV: "test" }).ok, true); });