Skip to content
Permalink
Browse files
fix(errors): throws with invalid route objects (#1893)
  • Loading branch information
posva committed Nov 17, 2017
1 parent 07d0298 commit c8376661e343a055c6d5a037509f70f5cdaf64be
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/unit/specs/create-map.spec.js
@@ -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()

0 comments on commit c837666

Please sign in to comment.