Skip to content

test: add unit tests for config loader env interpolation #2

Description

@tanmayjoddar

Why

src/config/loader.js interpolates ${VAR} from environment variables. This is core to auth/header UX, but currently untested.

Where

  • src/config/loader.js
  • Add: tests/config/loader.test.js (or similar)

Acceptance Criteria

  • When apidrift.config.json does not exist, loadConfig() returns defaults (empty environments + endpoints + heuristic discovery)
  • When config contains ${STAGING_TOKEN}, it is replaced by process.env.STAGING_TOKEN
  • When env var is missing, interpolation produces an empty string (current behavior)
  • Tests set up and clean up temp working directory (no real files in repo root)
  • npm test passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxDeveloper experiencegood first issueGood for first-time contributorsgssocGSSoC

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions