Skip to content

test(router): added useParams tests for optional and catch-all route segments - #42

Open
tmdeveloper007 wants to merge 4 commits into
mainfrom
#3292
Open

test(router): added useParams tests for optional and catch-all route segments#42
tmdeveloper007 wants to merge 4 commits into
mainfrom
#3292

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Owner

Summary of What Has Been Done

Added with 6 test cases for useParams with catch-all and standard route segments.

Changes Made

  • Created with 6 test cases:
    • Catch-all : /docs/a/b/c captures path="a/b/c"
    • Static route alongside catch-all: /docs returns empty params
    • Catch-all with single segment: /files/readme.md captures rest="readme.md"
    • Regular param alongside catch-all: /user/[id]/[...rest] captures both
    • Route without params: /about returns empty params object
    • Required param without optional syntax: /item/[id] works correctly

Impact it Made

  • Documents expected behavior for catch-all route parameters
  • Prevents regressions when route matching logic changes
  • Covers the important catch-all routing pattern used in real-world apps

Closes Karanjot786#3292.

Note: please assign this PR to the tmdeveloper007 account.

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.

test(router): add useParams tests for optional and catch-all route segments

1 participant