Skip to content

Commit c837666

Browse files
authored
fix(errors): throws with invalid route objects (#1893)
1 parent 07d0298 commit c837666

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ describe('Creating Route Map', function () {
7171
expect(console.warn.calls.argsFor(0)[0]).toMatch('vue-router] Named Route \'bar\'')
7272
})
7373

74+
it('in development, throws if path is missing', function () {
75+
process.env.NODE_ENV = 'development'
76+
expect(() => {
77+
maps = createRouteMap([{ component: Bar }])
78+
}).toThrowError(/"path" is required/)
79+
})
80+
7481
it('in production, it has not logged this warning', function () {
7582
maps = createRouteMap(routes)
7683
expect(console.warn).not.toHaveBeenCalled()

0 commit comments

Comments
 (0)