Skip to content

feat(github): add mock GitHub API response for local development#53

Merged
evirunurm merged 1 commit into
mainfrom
feat/add-github-api-mock
Mar 20, 2026
Merged

feat(github): add mock GitHub API response for local development#53
evirunurm merged 1 commit into
mainfrom
feat/add-github-api-mock

Conversation

@evirunurm
Copy link
Copy Markdown
Owner

@evirunurm evirunurm commented Mar 20, 2026

Summary

  • Adds MOCK_RESPONSE fixture in scripts/github/__mock__/mockGithubApiResponse.ts with realistic fake data (repos, stars, forks, languages, followers, contributions)
  • githubApiClient.ts short-circuits to the mock when MOCK_GITHUB=true is set in .env, skipping real GitHub API calls
  • Enables running the project locally without a valid GITHUB_TOKEN

Test plan

  • Add MOCK_GITHUB=true to .env
  • Run vercel dev
  • Hit http://localhost:3000/api/stats?username=anyone — should return an SVG card
  • Hit http://localhost:3000/api/languages?username=anyone — should return an SVG card
  • Remove MOCK_GITHUB=true and verify real API calls still work with a valid token

🤖 Generated with Claude Code

@evirunurm evirunurm self-assigned this Mar 20, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-stats-uvqq Ready Ready Preview, Comment Mar 20, 2026 2:02am

@evirunurm evirunurm merged commit d5b3da5 into main Mar 20, 2026
3 checks passed
@evirunurm evirunurm deleted the feat/add-github-api-mock branch March 20, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant