Skip to content

Commit 494221d

Browse files
committed
test: trailing slash
1 parent a3ce3ed commit 494221d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/router/src/experimental/route-resolver/matchers/matcher-pattern.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ describe('MatcherPatternPathStatic', () => {
2929
expect(pattern.match('/TEAM')).toEqual({})
3030
expect(pattern.match('/tEAm')).toEqual({})
3131
})
32+
33+
it('keeps a trailing slash', () => {
34+
const pattern = new MatcherPatternPathStatic('/team/')
35+
expect(pattern.match('/team/')).toEqual({})
36+
})
37+
38+
it('strict on trailing slash', () => {
39+
expect(() =>
40+
new MatcherPatternPathStatic('/team').match('/team/')
41+
).toThrow()
42+
expect(() =>
43+
new MatcherPatternPathStatic('/team/').match('/team')
44+
).toThrow()
45+
})
3246
})
3347

3448
describe('build()', () => {

0 commit comments

Comments
 (0)