Skip to content

Commit b505400

Browse files
committed
test(match): add test for asterisk route with props: true
1 parent ad2a988 commit b505400

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/unit/specs/create-matcher.spec.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { createMatcher } from '../../../src/create-matcher'
33

44
const routes = [
55
{ path: '/', name: 'home', component: { name: 'home' }},
6-
{ path: '/foo', name: 'foo', component: { name: 'foo' }}
6+
{ path: '/foo', name: 'foo', component: { name: 'foo' }},
7+
{ path: '*', props: true, component: { name: 'notFound' }}
78
]
89

910
describe('Creating Matcher', function () {
@@ -32,4 +33,9 @@ describe('Creating Matcher', function () {
3233
match({ name: 'foo' }, routes[0])
3334
expect(console.warn).not.toHaveBeenCalled()
3435
})
36+
37+
it('matches asterisk routes with fullName as the param', function () {
38+
const { params } = match({ path: '/not-found' }, routes[0])
39+
expect(params).toEqual({ fullPath: '/not-found' })
40+
})
3541
})

0 commit comments

Comments
 (0)