From 3cc7f721c9646f83595610252ddbde116c0fac27 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 17 Nov 2017 19:26:24 +0100 Subject: [PATCH] test(errors): test it throws with no path --- 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()