Skip to content

Commit

Permalink
test(errors): test it throws with no path
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Nov 17, 2017
1 parent 07d0298 commit 3cc7f72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/specs/create-map.spec.js
Expand Up @@ -71,6 +71,13 @@ describe('Creating Route Map', function () {
expect(console.warn.calls.argsFor(0)[0]).toMatch('vue-router] Named Route \'bar\'')
})

it('in development, throws if path is missing', function () {
process.env.NODE_ENV = 'development'
expect(() => {
maps = createRouteMap([{ component: Bar }])
}).toThrowError(/"path" is required/)
})

it('in production, it has not logged this warning', function () {
maps = createRouteMap(routes)
expect(console.warn).not.toHaveBeenCalled()
Expand Down

0 comments on commit 3cc7f72

Please sign in to comment.