fix(router): throw an error when encounter undefined route (#12389)

This commit is contained in:
Dzmitry Shylovich
2016-11-11 01:55:10 +03:00
committed by Victor Berchet
parent 3052fb234f
commit 77dc1ab675
3 changed files with 23 additions and 2 deletions

View File

@ -15,6 +15,12 @@ describe('config', () => {
validateConfig([{path: 'a', redirectTo: 'b'}, {path: 'b', component: ComponentA}]);
});
it('should throw for undefined route', () => {
expect(() => {
validateConfig([{path: 'a', component: ComponentA}, , {path: 'b', component: ComponentB}]);
}).toThrowError();
});
it('should throw when Array is passed', () => {
expect(() => {
validateConfig([