feat(Router): add extra validation for when route was passed as Array (#9942)
This commit is contained in:

committed by
Victor Berchet

parent
85be729c70
commit
aa88438b54
@ -6,6 +6,15 @@ describe('config', () => {
|
||||
validateConfig([{path: 'a', redirectTo: 'b'}, {path: 'b', component: ComponentA}]);
|
||||
});
|
||||
|
||||
it('should throw when Array is passed', () => {
|
||||
expect(() => {
|
||||
validateConfig([
|
||||
{path: 'a', component: ComponentA},
|
||||
[{path: 'b', component: ComponentB}, {path: 'c', component: ComponentC}]
|
||||
]);
|
||||
}).toThrowError(`Invalid route configuration: Array cannot be specified`);
|
||||
});
|
||||
|
||||
it('should throw when redirectTo and children are used together', () => {
|
||||
expect(() => {
|
||||
validateConfig(
|
||||
|
Reference in New Issue
Block a user