Skip to content

Commit

Permalink
test(match): add test for asterisk route with props: true
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Apr 9, 2018
1 parent ad2a988 commit b505400
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/unit/specs/create-matcher.spec.js
Expand Up @@ -3,7 +3,8 @@ import { createMatcher } from '../../../src/create-matcher'

const routes = [
{ path: '/', name: 'home', component: { name: 'home' }},
{ path: '/foo', name: 'foo', component: { name: 'foo' }}
{ path: '/foo', name: 'foo', component: { name: 'foo' }},
{ path: '*', props: true, component: { name: 'notFound' }}
]

describe('Creating Matcher', function () {
Expand Down Expand Up @@ -32,4 +33,9 @@ describe('Creating Matcher', function () {
match({ name: 'foo' }, routes[0])
expect(console.warn).not.toHaveBeenCalled()
})

it('matches asterisk routes with fullName as the param', function () {
const { params } = match({ path: '/not-found' }, routes[0])
expect(params).toEqual({ fullPath: '/not-found' })
})
})

0 comments on commit b505400

Please sign in to comment.