Skip to content

test: add tests for useRepositoryUrl composable #2249

Merged
ghostdevv merged 6 commits intonpmx-dev:mainfrom
howwohmm:ghost/test/2233
Mar 24, 2026
Merged

test: add tests for useRepositoryUrl composable #2249
ghostdevv merged 6 commits intonpmx-dev:mainfrom
howwohmm:ghost/test/2233

Conversation

@howwohmm
Copy link
Contributor

@howwohmm howwohmm commented Mar 23, 2026

Add tests for the useRepositoryUrl

…ndling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 23, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 24, 2026 7:29am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 24, 2026 7:29am
npmx-lunaria Ignored Ignored Mar 24, 2026 7:29am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c6b18ffa-5735-4ad9-bb23-2a413b103e74

📥 Commits

Reviewing files that changed from the base of the PR and between 09a6ac2 and 0103106.

📒 Files selected for processing (1)
  • test/nuxt/composables/use-repository-url.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/nuxt/composables/use-repository-url.spec.ts

📝 Walkthrough

Walkthrough

Adds a Vitest test suite for the useRepositoryUrl composable. The tests verify normalization of repository URLs (removing git+ prefixes and .git suffixes), handling of monorepo repository.directory by appending /tree/HEAD/{directory} (preserving trailing slashes), and that repositoryUrl becomes null when repository is missing or lacks a url. Also confirms plain https:// repository URLs without .git are returned unchanged.

Possibly related PRs

Suggested reviewers

  • MatteoGabriele
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description 'Add tests for the useRepositoryUrl' directly relates to the changeset, which adds a test file for the useRepositoryUrl composable.
Linked Issues check ✅ Passed The pull request adds comprehensive tests covering all key requirements from issue #2233: normalisation of .git suffixes and git+ prefixes, correct construction of /tree/HEAD/{directory} for monorepo packages, and null handling for missing repository fields.
Out of Scope Changes check ✅ Passed All changes are within scope: the single file addition is a test suite for useRepositoryUrl composable addressing regression prevention for the repository URL normalisation requirements specified in issue #2233.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a31ac5af-01ad-43ae-a3fd-d1da26df5c4a

📥 Commits

Reviewing files that changed from the base of the PR and between 50491e6 and 1a301a2.

📒 Files selected for processing (1)
  • test/nuxt/composables/use-repository-url.spec.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@howwohmm howwohmm changed the title test(useRepositoryUrl): add regression tests for monorepo .git URL handling test: add regression tests for monorepo .git URL handling Mar 23, 2026
@ghostdevv ghostdevv self-requested a review March 23, 2026 21:21
@ghostdevv ghostdevv changed the title test: add regression tests for monorepo .git URL handling test: add tests for useRepositoryUrl composable Mar 24, 2026
Copy link
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

This doesn't seem to have helped with #2233 as the tests were passing before the fix was merged, however we can turn still use the tests for coverage. I've updated to fix the type errors and remove the big at the top

@ghostdevv ghostdevv added this pull request to the merge queue Mar 24, 2026
Merged via the queue into npmx-dev:main with commit 84a7fc9 Mar 24, 2026
21 checks passed
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.

2 participants