From: Eduardo San Martin Morote Date: Sun, 24 Aug 2025 19:39:38 +0000 (+0200) Subject: test: trailing slash X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=494221d3958988f5d49b2205c74c132c464c6cb0;p=thirdparty%2Fvuejs%2Frouter.git test: trailing slash --- diff --git a/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.spec.ts b/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.spec.ts index ac28af0a..9b660d1f 100644 --- a/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.spec.ts +++ b/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.spec.ts @@ -29,6 +29,20 @@ describe('MatcherPatternPathStatic', () => { expect(pattern.match('/TEAM')).toEqual({}) expect(pattern.match('/tEAm')).toEqual({}) }) + + it('keeps a trailing slash', () => { + const pattern = new MatcherPatternPathStatic('/team/') + expect(pattern.match('/team/')).toEqual({}) + }) + + it('strict on trailing slash', () => { + expect(() => + new MatcherPatternPathStatic('/team').match('/team/') + ).toThrow() + expect(() => + new MatcherPatternPathStatic('/team/').match('/team') + ).toThrow() + }) }) describe('build()', () => {