Skip to content

Commit efc026e

Browse files
committed
Extra tests for end handling
1 parent 4fce5c0 commit efc026e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/router/__tests__/matcher/pathParser.spec.ts

+17
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,23 @@ describe('Path parser', () => {
618618
matchParams('/home', '/other/home', {}, { start: false })
619619
})
620620

621+
it('defaults to matching the end', () => {
622+
// The default should behave like `end: true`
623+
const optionSets = [{}, { end: true }]
624+
625+
for (const options of optionSets) {
626+
matchParams('/home', '/home', {}, options)
627+
matchParams('/home', '/home/', {}, options)
628+
matchParams('/home', '/home/other', null, options)
629+
matchParams('/home', '/homepage', null, options)
630+
631+
matchParams('/home/', '/home', {}, options)
632+
matchParams('/home/', '/home/', {}, options)
633+
matchParams('/home/', '/home/other', null, options)
634+
matchParams('/home/', '/homepage', null, options)
635+
}
636+
})
637+
621638
it('can not match the end', () => {
622639
const options = { end: false }
623640

0 commit comments

Comments
 (0)