import { strictEqual } from "node:assert";
import { describe, it } from "node:test";
import { stringifyConfig } from "./stringify-config.js";
describe("stringifyConfig", () => {
    it("should handle env var patterns", () => {
        const config = {
            enabled: true,
            count: 42,
            ratio: 3.14,
            empty: null,
            notDefined: undefined,
            normalString: "regular string",
            apiKey: "$env(API_KEY)",
            dbUrl: "$env(DATABASE_URL)",
            title: "$env(APP_TITLE) Portal",
            baseUrl: "https://$env(DOMAIN)",
            fullUrl: "https://$env(HOST):$env(PORT)/api",
            message: "$env(APP_NAME) version $env(VERSION)",
            secret: "$env(JWT_SECRET_KEY_123)",
            description: 'App "with quotes" $env(APP_NAME)',
            multiline: "Line1\nLine2 $env(VAR)",
            metadata: {
                favicon: "$env(FAVICON_URL)",
                title: "Welcome to $env(SITE_NAME)",
            },
            navigation: [
                "$env(HOME_PATH)",
                "static/path",
                "prefix $env(DYNAMIC_PATH)",
                "$env(API_PATH) suffix",
            ],
            authentication: {
                oauth: {
                    clientId: "$env(OAUTH_CLIENT_ID)",
                    issuer: "$env(OAUTH_ISSUER)/auth",
                    scopes: ["read", "$env(OAUTH_SCOPE)"],
                },
            },
        };
        const expected = `{
  enabled: true,
  count: 42,
  ratio: 3.14,
  empty: null,
  notDefined: undefined,
  normalString: 'regular string',
  apiKey: process.env.API_KEY,
  dbUrl: process.env.DATABASE_URL,
  title: process.env.APP_TITLE + " Portal",
  baseUrl: "https://" + process.env.DOMAIN,
  fullUrl: "https://" + process.env.HOST + ":" + process.env.PORT + "/api",
  message: process.env.APP_NAME + " version " + process.env.VERSION,
  secret: process.env.JWT_SECRET_KEY_123,
  description: "App \\"with quotes\\" " + process.env.APP_NAME,
  multiline: "Line1\\nLine2 " + process.env.VAR,
  metadata: {
    favicon: process.env.FAVICON_URL,
    title: "Welcome to " + process.env.SITE_NAME
  },
  navigation: [
    process.env.HOME_PATH,
    'static/path',
    "prefix " + process.env.DYNAMIC_PATH,
    process.env.API_PATH + " suffix"
  ],
  authentication: {
    oauth: {
      clientId: process.env.OAUTH_CLIENT_ID,
      issuer: process.env.OAUTH_ISSUER + "/auth",
      scopes: [
        'read',
        process.env.OAUTH_SCOPE
      ]
    }
  }
}`;
        strictEqual(stringifyConfig(config), expected);
    });
});
//# sourceMappingURL=stringify-config.test.js.map