Skip to content

test: improve test coverage to 90%+#9

Merged
GeiserX merged 1 commit intomainfrom
test/improve-coverage
Apr 25, 2026
Merged

test: improve test coverage to 90%+#9
GeiserX merged 1 commit intomainfrom
test/improve-coverage

Conversation

@GeiserX
Copy link
Copy Markdown
Owner

@GeiserX GeiserX commented Apr 25, 2026

Summary

  • Add @vitest/coverage-v8 and vitest.config.ts for V8 coverage collection
  • Add codecov.yml with 90% project/patch targets
  • Add dedicated coverage CI job with Codecov upload
  • Add comprehensive tests for all previously uncovered modules:
    • ghost.ts: fetchPage, updatePage (was 33% -> 100%)
    • github.ts: fetchPortfolioConfig, detectBanner edge cases, verbose mode (was 71% -> 97%)
    • generator.ts: all renderCustomBadge types, personalNote, keyFeatures, footer variants (was 85% -> 100%)
    • index.ts: CLI sync and init commands with fully mocked dependencies (was 0% -> 100%)
  • Final coverage: 99.57% statements, 90.87% branches, 95.65% functions, 99.57% lines
  • 96 tests total, all passing

Test plan

  • All 96 tests pass locally with npx vitest run
  • Coverage report confirms 90%+ across all metrics
  • CI pipeline passes (build + test + coverage + docker)
  • Codecov upload succeeds (requires CODECOV_TOKEN secret)

Add comprehensive tests for ghost.ts (fetchPage, updatePage), github.ts
(fetchPortfolioConfig, detectBanner edge cases), generator.ts (all custom
badge types, personalNote, keyFeatures, footer variants), and index.ts
(CLI sync/init commands with mocked dependencies).

Configure @vitest/coverage-v8, add codecov.yml, add CI coverage job with
Codecov upload. Coverage: 99.57% statements, 90.87% branches.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

Warning

Rate limit exceeded

@GeiserX has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 32 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 32 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 523f4ef4-1381-4e13-86f8-331715dcf0c3

📥 Commits

Reviewing files that changed from the base of the PR and between 5bd23d4 and ea5163f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • codecov.yml
  • package.json
  • src/generator.test.ts
  • src/ghost.test.ts
  • src/github.test.ts
  • src/index.test.ts
  • vitest.config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/improve-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GeiserX GeiserX merged commit 0a5de75 into main Apr 25, 2026
9 checks passed
@GeiserX GeiserX deleted the test/improve-coverage branch April 25, 2026 01:46
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