feat: simplify testing structure into api and e2e categories

This commit is contained in:
bipproduction
2026-02-08 11:01:55 +08:00
parent 4640b72ca6
commit 0f71798389
18 changed files with 1006 additions and 62 deletions

View File

@@ -0,0 +1,23 @@
import { describe, expect, it } from "bun:test";
import { getEnv } from "@/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.TEST_ENV_KEY = "test-value";
const val = getEnv("TEST_ENV_KEY");
expect(val).toBe("test-value");
// Clean up
delete process.env.TEST_ENV_KEY;
});
});
});