Skip to content

test : add unit tests for upstash-rest.ts getUpstashConfig #3031

Closed as not planned

Description

@tmdeveloper007

Summary of What Needs to be Done: Add unit tests for src/lib/upstash-rest.ts, specifically the getUpstashConfig() function. This is the only pure function in the module — all other functions make network calls to the Upstash API and require mocking fetch.

Changes that Need to be Made:

  • Create test/upstash-rest.test.ts with Vitest
  • Test getUpstashConfig: when UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN are both set in env, verify it returns { url, token }; when either is missing, verify it returns null; when either is empty string, verify it returns null

Impact that it would Provide: getUpstashConfig is the configuration gate for the entire Upstash integration. Tests prevent regression when env var names change or when the null-guard logic is accidentally modified. The test is fast and requires no network mocking.

Hello @Priyanshu-byte-coder, please assign this issue to me (@tmdeveloper007) so I can open a focused PR.

Activity

  1. aaniya22 commented on Jul 12, 2026

    @aaniya22
    Contributor

    pls assign this to me under gssoc

  2. github-actions commented on Jul 12, 2026

    @github-actions

    Assigned to @aaniya22! You have 7 days to open a PR. No PR after 7 days = auto-unassigned so others can pick it up. Good luck!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions