Skip to content

Add tests for getDefaultBranch - #308

Merged
5ouma merged 2 commits into
mainfrom
test-utils-get-default-branch
Sep 27, 2025
Merged

5ouma merged 2 commits into
mainfrom
test-utils-get-default-branch

Conversation

@5ouma

@5ouma 5ouma commented Sep 27, 2025

Copy link
Copy Markdown
Owner

⚠️ Issue

close #


✏️ Description

Its abnormal system is not tested.


Its abnormal system is not tested.
Copilot AI review requested due to automatic review settings September 27, 2025 11:48
@github-actions github-actions Bot added the 🧪 Testing Adding missing tests or correcting existing tests label Sep 27, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds test coverage for the getDefaultBranch function to address previously untested functionality. The tests verify both normal operation and fallback behavior when a repository's default branch cannot be determined.

  • Adds comprehensive test coverage for getDefaultBranch function
  • Tests both normal repository scenarios and unknown/fallback cases
  • Validates fallback to "master" branch when default branch detection fails

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/libs/utils.test.ts Outdated
@codecov

codecov Bot commented Sep 27, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (53ccc00) to head (2ef771e).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #308   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          115       115           
  Branches         9         9           
=========================================
  Hits           115       115           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

It's not needed.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Souma <[email protected]>
@deno-deploy
deno-deploy Bot temporarily deployed to Preview September 27, 2025 11:51 Inactive
@github-actions github-actions Bot added the 🎨 Style Changes that do not affect the meaning of the code label Sep 27, 2025
@5ouma

5ouma commented Sep 27, 2025

Copy link
Copy Markdown
Owner Author

@coderabbitai approve

@5ouma 5ouma changed the title Add for getDefaultBranch Add tests for getDefaultBranch Sep 27, 2025
@5ouma
5ouma merged commit 0203958 into main Sep 27, 2025
16 checks passed
@5ouma
5ouma deleted the test-utils-get-default-branch branch September 27, 2025 11:55
@5ouma 5ouma Bot mentioned this pull request Sep 27, 2025
@5ouma 5ouma removed the 🎨 Style Changes that do not affect the meaning of the code label Sep 27, 2025
@coderabbitai

coderabbitai Bot commented Sep 27, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new test file to validate getDefaultBranch, covering a normal repository returning "main" and a fallback case returning "master".

Changes

Cohort / File(s) Change Summary
Tests: getDefaultBranch
src/libs/utils.test.ts
Added test suite "Get Default Branch" with two cases: verifies default branch "main" for known repo and fallback to "master" for unknown repo; imports getDefaultBranch and test utilities.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-utils-get-default-branch

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53ccc00 and 2ef771e.

📒 Files selected for processing (1)
  • src/libs/utils.test.ts (1 hunks)

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.

@coderabbitai

coderabbitai Bot commented Sep 27, 2025

Copy link
Copy Markdown
✅ Actions performed

Comments resolved and changes approved.

This branch was previously deployed

1 inactive deployment
Preview — 2ef771e3 Deployed Sep 27, 2025 by deno-deploy[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧪 Testing Adding missing tests or correcting existing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants