Files
united-workforce/packages/util/__tests__/env.test.ts
T
xingyue 5970456a54
CI / check (pull_request) Failing after 8m30s
refactor: align package folder names with npm package names
Rename packages/ subdirectories to match their @united-workforce/* scope:
  cli-workflow → cli
  workflow-agent-builtin → agent-builtin
  workflow-agent-claude-code → agent-claude-code
  workflow-agent-hermes → agent-hermes
  workflow-dashboard → dashboard
  workflow-protocol → protocol
  workflow-util-agent → util-agent
  workflow-util → util

Updated all tsconfig references, scripts, and active docs.
Historical docs (docs/plans/, docs/superpowers/) left as-is.

Closes #21
2026-06-02 23:45:45 +08:00

21 lines
601 B
TypeScript

import { describe, expect, it } from "bun:test";
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;
});
});