Skip to content

[Bounty: $95] Add unit tests for the env.ts config loaders loadEmailJSConfig, loadSupabaseConfig and loadAdminConfig #94

Description

@Onis2254

Context
tests/lib/env.test.ts only covers isAdminEmail/isDevelopment/isProduction. The loaders in lib/env.ts (loadEmailJSConfig 142-165, loadSupabaseConfig 168-185, loadAdminConfig 188-197) and the requireEnv/getEnv helpers (76-99) with their error-accumulation, whitespace-as-missing and list-normalization behaviour are untested.

Proposed Change
Extend tests/lib/env.test.ts to stub env per case and assert: each missing required field pushes one error with the right message; whitespace-only values count as missing; loadEmailJSConfig leaves the default recipient undefined when unset; loadAdminConfig trims/lowercases entries, drops empties and returns [] for blank or comma-only strings.

Acceptance Criteria

  • Errors arrays and messages are asserted per loader under vi.stubEnv
  • Whitespace-only and empty-list cases are covered
  • npm run test passes

Suggested Label: tests

ETA: 24 hours

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions