e5e6de2fad
- Replace bun:test with vitest across all packages - Replace bun build with esbuild - Replace bun:sqlite with better-sqlite3 - Fix OCAS Store API: store.put/get → store.cas.put/get - Fix vitest vi.mock hoisting (vi.hoisted) - Add pnpm-workspace.yaml and pnpm-lock.yaml - Update all package.json test/build scripts WIP: 8 failures remain in agent-hermes (bun engines check + sqlite migration) Refs #26
21 lines
599 B
TypeScript
21 lines
599 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { env } from "../src/env.js";
|
|
|
|
describe("env", () => {
|
|
it("returns env value when set", () => {
|
|
process.env.TEST_ENV_SET = "hello";
|
|
expect(env("TEST_ENV_SET", "default")).toBe("hello");
|
|
delete process.env.TEST_ENV_SET;
|
|
});
|
|
|
|
it("returns fallback when missing", () => {
|
|
expect(env("TEST_ENV_MISSING_XYZ", "fallback")).toBe("fallback");
|
|
});
|
|
|
|
it("returns fallback when empty", () => {
|
|
process.env.TEST_ENV_EMPTY = "";
|
|
expect(env("TEST_ENV_EMPTY", "fb")).toBe("fb");
|
|
delete process.env.TEST_ENV_EMPTY;
|
|
});
|
|
});
|