Skip to content

Commit 1077c2c

Browse files
committed
test: add case test
1 parent f8c6ac1 commit 1077c2c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/unit/specs/location.spec.js

+10
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ describe('Location utils', () => {
7979
})
8080

8181
it('relative params (non-named)', () => {
82+
const loc = normalizeLocation({ params: { lang: 'fr' }}, {
83+
path: '/en/foo',
84+
params: { lang: 'en', id: 'foo' },
85+
matched: [{ path: '/:lang(en|fr)/:id' }]
86+
})
87+
expect(loc._normalized).toBe(true)
88+
expect(loc.path).toBe('/fr/foo')
89+
})
90+
91+
it('custom regex can be case insensitive', () => {
8292
const loc = normalizeLocation({ params: { lang: 'FR' }}, {
8393
path: '/en/foo',
8494
params: { lang: 'en', id: 'foo' },

0 commit comments

Comments
 (0)