Files
dashboard-desaplus-noc/__tests__/features.test.ts
2026-02-07 23:57:37 +08:00

23 lines
635 B
TypeScript

import { describe, expect, it } from "vitest";
import { getEnv } from "../src/utils/env";
describe("Feature Utilities", () => {
describe("getEnv Utility", () => {
it("should return default value if env is not found", () => {
const val = getEnv("NON_EXISTENT_KEY", "fallback");
expect(val).toBe("fallback");
});
it("should return value from process.env if available", () => {
// Mock process.env
const originalEnv = process.env;
process.env = { ...originalEnv, TEST_ENV_KEY: "test-value" };
const val = getEnv("TEST_ENV_KEY");
expect(val).toBe("test-value");
process.env = originalEnv;
});
});
});