Skip to content

Add unit tests for the typed configuration validation layer #77

Description

@Lakes41
  • Difficulty: Intermediate
  • Type: test
  • Background: The README describes a "typed configuration layer" validating EXPO_PUBLIC_API_URL and EXPO_PUBLIC_CHAIN_ID at startup, throwing a developer-facing error if missing/invalid rather than silently falling back to production defaults.
  • Problem: This safety-critical startup validation logic has no documented/visible test coverage, risking silent regressions that reintroduce unsafe fallbacks.
  • Expected outcome: A dedicated test file verifying: missing var throws, malformed URL throws, invalid chainId (non-numeric or unsupported) throws, and valid config passes through unchanged.
  • Suggested implementation: Locate the config module (likely src/config/ or src/lib/config.ts), write Vitest cases mocking process.env/Constants.expoConfig.extra, assert thrown error messages are actionable.
  • Acceptance criteria: All four scenarios above are covered; tests fail if fallback-to-production-default behavior is reintroduced; pnpm typecheck remains clean.
  • Likely affected files/directories: src/ (config module), tests/
  • Labels: test, good first issue, GrantFox OSS, Maybe Rewarded, Official Campaign | FWC26

Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsgood first issueWell-scoped issue suitable for contributors making an initial contribution to the projecttestTest coverage additions, test fixes, or test infrastructure work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions