From c8376661e343a055c6d5a037509f70f5cdaf64be Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 17 Nov 2017 19:41:59 +0100 Subject: [PATCH] fix(errors): throws with invalid route objects (#1893) --- test/unit/specs/create-map.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unit/specs/create-map.spec.js b/test/unit/specs/create-map.spec.js index 9d8e62f36..67fba131a 100644 --- a/test/unit/specs/create-map.spec.js +++ b/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()