build: add bazel test rules for remainder of packages (#21053)

PR Close #21053
This commit is contained in:
Misko Hevery
2017-12-17 15:10:54 -08:00
committed by Igor Minar
parent cc1058f6e1
commit 3d50fd7cac
88 changed files with 912 additions and 322 deletions

View File

@ -8,13 +8,13 @@
import {Routes} from '../src/config';
import {recognize} from '../src/recognize';
import {ActivatedRouteSnapshot, ParamsInheritanceStrategy, RouterStateSnapshot, inheritedParamsDataResolve} from '../src/router_state';
import {ActivatedRouteSnapshot, RouterStateSnapshot} from '../src/router_state';
import {PRIMARY_OUTLET, Params} from '../src/shared';
import {DefaultUrlSerializer, UrlTree} from '../src/url_tree';
describe('recognize', () => {
it('should work', () => {
checkRecognize([{path: 'a', component: ComponentA}], 'a', (s: RouterStateSnapshot) => {
checkRecognize([{path: 'a', component: ComponentA}], 'a', (s: any) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
});
@ -23,7 +23,7 @@ describe('recognize', () => {
it('should freeze params object', () => {
checkRecognize([{path: 'a/:id', component: ComponentA}], 'a/10', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
const child = s.firstChild(s.root) !;
const child = (s as any).firstChild(s.root) !;
expect(Object.isFrozen(child.params)).toBeTruthy();
});
});
@ -35,7 +35,7 @@ describe('recognize', () => {
{path: 'c', component: ComponentC, outlet: 'right'}
],
'a(left:b//right:c)', (s: RouterStateSnapshot) => {
const c = s.children(s.root);
const c = (s as any).children(s.root);
checkActivatedRoute(c[0], 'a', {}, ComponentA);
checkActivatedRoute(c[1], 'b', {}, ComponentB, 'left');
checkActivatedRoute(c[2], 'c', {}, ComponentC, 'right');
@ -51,18 +51,18 @@ describe('recognize', () => {
{path: 'c', component: ComponentC, outlet: 'right'}
],
url, 'a(left:b//right:c)')
.subscribe((s) => {
.subscribe((s: any) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
const c = s.children(s.root);
expect(c[0]._urlSegment).toBe(url.root.children[PRIMARY_OUTLET]);
const c = (s as any).children(s.root);
expect(c[0]._urlSegment).toBe((url.root as any).children[PRIMARY_OUTLET]);
expect(c[0]._lastPathIndex).toBe(0);
expect(c[1]._urlSegment).toBe(url.root.children['left']);
expect(c[1]._urlSegment).toBe((url.root as any).children['left']);
expect(c[1]._lastPathIndex).toBe(0);
expect(c[2]._urlSegment).toBe(url.root.children['right']);
expect(c[2]._urlSegment).toBe((url.root as any).children['right']);
expect(c[2]._lastPathIndex).toBe(0);
});
});
@ -76,15 +76,15 @@ describe('recognize', () => {
],
url, 'a/b/c')
.subscribe((s: RouterStateSnapshot) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
expect((s.root as any)._urlSegment).toBe(url.root);
expect((s.root as any)._lastPathIndex).toBe(-1);
const compA = s.firstChild(s.root) !;
expect(compA._urlSegment).toBe(url.root.children[PRIMARY_OUTLET]);
const compA = (s as any).firstChild(s.root) !;
expect(compA._urlSegment).toBe((url.root as any).children[PRIMARY_OUTLET]);
expect(compA._lastPathIndex).toBe(1);
const compC = s.firstChild(<any>compA) !;
expect(compC._urlSegment).toBe(url.root.children[PRIMARY_OUTLET]);
const compC = (s as any).firstChild(<any>compA) !;
expect(compC._urlSegment).toBe((url.root as any).children[PRIMARY_OUTLET]);
expect(compC._lastPathIndex).toBe(2);
});
});
@ -97,16 +97,16 @@ describe('recognize', () => {
{path: 'a', component: ComponentA, children: [{path: '**', component: ComponentB}]},
],
url, 'a/b/c')
.subscribe((s: RouterStateSnapshot) => {
.subscribe((s: any) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
const compA = s.firstChild(s.root) !;
expect(compA._urlSegment).toBe(url.root.children[PRIMARY_OUTLET]);
const compA = (s as any).firstChild(s.root) !;
expect(compA._urlSegment).toBe((url as any).root.children[PRIMARY_OUTLET]);
expect(compA._lastPathIndex).toBe(0);
const compC = s.firstChild(<any>compA) !;
expect(compC._urlSegment).toBe(url.root.children[PRIMARY_OUTLET]);
const compC = (s as any).firstChild(<any>compA) !;
expect(compC._urlSegment).toBe((url as any).root.children[PRIMARY_OUTLET]);
expect(compC._lastPathIndex).toBe(2);
});
});
@ -119,16 +119,18 @@ describe('recognize', () => {
],
'a/paramA', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute(
s.firstChild(<any>s.firstChild(s.root)) !, 'paramA', {id: 'paramA'}, ComponentB);
(s as any).firstChild(<any>(s as any).firstChild(s.root)) !, 'paramA', {id: 'paramA'},
ComponentB);
});
checkRecognize(
[{path: 'a', component: ComponentA}, {path: 'a/:id', component: ComponentC}], 'a/paramA',
(s: RouterStateSnapshot) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
checkActivatedRoute(s.firstChild(s.root) !, 'a/paramA', {id: 'paramA'}, ComponentC);
checkActivatedRoute(
(s as any).firstChild(s.root) !, 'a/paramA', {id: 'paramA'}, ComponentC);
});
});
@ -139,7 +141,7 @@ describe('recognize', () => {
{path: 'b', component: ComponentC, outlet: 'right'}
],
'a(right:b)', (s: RouterStateSnapshot) => {
const c = s.children(s.root);
const c = (s as any).children(s.root);
checkActivatedRoute(c[0], 'a', {}, ComponentA);
checkActivatedRoute(c[1], 'b', {}, ComponentC, 'right');
});
@ -158,7 +160,7 @@ describe('recognize', () => {
},
],
'a/(b//left:c)', (s: RouterStateSnapshot) => {
const c = s.children(<any>s.firstChild(s.root));
const c = (s as any).children(<any>(s as any).firstChild(s.root));
checkActivatedRoute(c[0], 'b', {}, ComponentB, PRIMARY_OUTLET);
checkActivatedRoute(c[1], 'c', {}, ComponentC, 'left');
});
@ -171,7 +173,7 @@ describe('recognize', () => {
{path: 'b', component: ComponentB, outlet: 'b'}
],
'a(c:c//b:b)', (s: RouterStateSnapshot) => {
const c = s.children(s.root);
const c = (s as any).children(s.root);
checkActivatedRoute(c[0], 'a', {}, ComponentA);
checkActivatedRoute(c[1], 'b', {}, ComponentB, 'b');
checkActivatedRoute(c[2], 'c', {}, ComponentC, 'c');
@ -185,9 +187,10 @@ describe('recognize', () => {
{path: 'c', component: ComponentC, outlet: 'left'}
],
'a;a1=11;a2=22/b;b1=111;b2=222(left:c;c1=1111;c2=2222)', (s: RouterStateSnapshot) => {
const c = s.children(s.root);
const c = (s as any).children(s.root);
checkActivatedRoute(c[0], 'a', {a1: '11', a2: '22'}, ComponentA);
checkActivatedRoute(s.firstChild(<any>c[0]) !, 'b', {b1: '111', b2: '222'}, ComponentB);
checkActivatedRoute(
(s as any).firstChild(<any>c[0]) !, 'b', {b1: '111', b2: '222'}, ComponentB);
checkActivatedRoute(c[1], 'c', {c1: '1111', c2: '2222'}, ComponentC, 'left');
});
});
@ -196,7 +199,7 @@ describe('recognize', () => {
it('should set static data', () => {
checkRecognize(
[{path: 'a', data: {one: 1}, component: ComponentA}], 'a', (s: RouterStateSnapshot) => {
const r: ActivatedRouteSnapshot = s.firstChild(s.root) !;
const r: ActivatedRouteSnapshot = (s as any).firstChild(s.root) !;
expect(r.data).toEqual({one: 1});
});
});
@ -209,7 +212,8 @@ describe('recognize', () => {
children: [{path: 'b', data: {two: 2}, component: ComponentB}]
}],
'a/b', (s: RouterStateSnapshot) => {
const r: ActivatedRouteSnapshot = s.firstChild(<any>s.firstChild(s.root)) !;
const r: ActivatedRouteSnapshot =
(s as any).firstChild(<any>(s as any).firstChild(s.root)) !;
expect(r.data).toEqual({one: 1, two: 2});
});
});
@ -222,7 +226,7 @@ describe('recognize', () => {
data: {one: 1},
children: [{path: 'b', data: {two: 2}, component: ComponentB}]
}],
'a/b', (s: RouterStateSnapshot) => {
'a/b', (s: any /* RouterStateSnapshot */) => {
const r: ActivatedRouteSnapshot = s.firstChild(<any>s.firstChild(s.root)) !;
expect(r.data).toEqual({two: 2});
});
@ -236,7 +240,7 @@ describe('recognize', () => {
data: {one: 1},
children: [{path: 'b', data: {two: 2}, component: ComponentB}]
}],
'a/b', (s: RouterStateSnapshot) => {
'a/b', (s: any /* RouterStateSnapshot */) => {
const r: ActivatedRouteSnapshot = s.firstChild(<any>s.firstChild(s.root)) !;
expect(r.data).toEqual({one: 1, two: 2});
}, 'always');
@ -244,9 +248,8 @@ describe('recognize', () => {
it('should set resolved data', () => {
checkRecognize(
[{path: 'a', resolve: {one: 'some-token'}, component: ComponentA}], 'a',
(s: RouterStateSnapshot) => {
const r: ActivatedRouteSnapshot = s.firstChild(s.root) !;
[{path: 'a', resolve: {one: 'some-token'}, component: ComponentA}], 'a', (s: any) => {
const r: any = s.firstChild(s.root) !;
expect(r._resolve).toEqual({one: 'some-token'});
});
});
@ -256,7 +259,7 @@ describe('recognize', () => {
describe('root', () => {
it('should work', () => {
checkRecognize([{path: '', component: ComponentA}], '', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, '', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, '', {}, ComponentA);
});
});
@ -264,7 +267,7 @@ describe('recognize', () => {
checkRecognize(
[{path: '', pathMatch: 'full', component: ComponentA}], '',
(s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, '', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, '', {}, ComponentA);
});
});
@ -272,18 +275,19 @@ describe('recognize', () => {
checkRecognize(
[{path: '', component: ComponentA, children: [{path: '', component: ComponentB}]}], '',
(s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, '', {}, ComponentA);
checkActivatedRoute(s.firstChild(<any>s.firstChild(s.root)) !, '', {}, ComponentB);
checkActivatedRoute((s as any).firstChild(s.root) !, '', {}, ComponentA);
checkActivatedRoute(
(s as any).firstChild(<any>(s as any).firstChild(s.root)) !, '', {}, ComponentB);
});
});
it('should set url segment and index properly', () => {
const url = tree('');
const url = tree('') as any;
recognize(
RootComponent,
[{path: '', component: ComponentA, children: [{path: '', component: ComponentB}]}], url,
'')
.forEach((s: RouterStateSnapshot) => {
.forEach((s: any) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
@ -307,10 +311,13 @@ describe('recognize', () => {
]
}],
'/a;p=1', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {p: '1'}, ComponentA);
checkActivatedRoute(s.firstChild(s.firstChild(s.root) !) !, '', {p: '1'}, ComponentB);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {p: '1'}, ComponentA);
checkActivatedRoute(
s.firstChild(s.firstChild(s.firstChild(s.root) !) !) !, '', {p: '1'}, ComponentC);
(s as any).firstChild((s as any).firstChild(s.root) !) !, '', {p: '1'},
ComponentB);
checkActivatedRoute(
(s as any).firstChild((s as any).firstChild((s as any).firstChild(s.root) !) !) !,
'', {p: '1'}, ComponentC);
});
});
});
@ -327,9 +334,9 @@ describe('recognize', () => {
]
}],
'a/b', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
const c = s.children(s.firstChild(s.root) !);
const c = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(c[0], 'b', {}, ComponentB);
checkActivatedRoute(c[1], '', {}, ComponentC, 'aux');
});
@ -358,13 +365,13 @@ describe('recognize', () => {
checkRecognize(config, 'parent/b', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
checkActivatedRoute(s.firstChild(s.root) !, 'parent', {}, undefined !);
checkActivatedRoute((s as any).firstChild(s.root) !, 'parent', {}, undefined !);
const cc = s.children(s.firstChild(s.root) !);
const cc = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(cc[0], '', {}, ComponentA);
checkActivatedRoute(cc[1], '', {}, ComponentD, 'secondary');
checkActivatedRoute(s.firstChild(cc[0]) !, 'b', {}, ComponentB);
checkActivatedRoute((s as any).firstChild(cc[0]) !, 'b', {}, ComponentB);
});
});
@ -379,16 +386,16 @@ describe('recognize', () => {
]
}],
'a/b', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
const c = s.children(s.firstChild(s.root) !);
const c = (s as any).children((s as any).firstChild(s.root) !);
expect(c.length).toEqual(1);
checkActivatedRoute(c[0], 'b', {}, ComponentB);
});
});
it('should set url segment and index properly', () => {
const url = tree('a/b');
const url = tree('a/b') as any;
recognize(
RootComponent, [{
path: 'a',
@ -399,7 +406,7 @@ describe('recognize', () => {
]
}],
url, 'a/b')
.forEach((s: RouterStateSnapshot) => {
.forEach((s: any) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
@ -418,7 +425,7 @@ describe('recognize', () => {
});
it('should set url segment and index properly when nested empty-path segments', () => {
const url = tree('a');
const url = tree('a') as any;
recognize(
RootComponent, [{
path: 'a',
@ -427,7 +434,7 @@ describe('recognize', () => {
]
}],
url, 'a')
.forEach((s: RouterStateSnapshot) => {
.forEach((s: any) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
@ -455,19 +462,19 @@ describe('recognize', () => {
]
}],
url, '')
.forEach((s: RouterStateSnapshot) => {
.forEach((s: any) => {
expect(s.root._urlSegment).toBe(url.root);
expect(s.root._lastPathIndex).toBe(-1);
const a = s.firstChild(s.root) !;
const a = (s as any).firstChild(s.root) !;
expect(a._urlSegment).toBe(url.root);
expect(a._lastPathIndex).toBe(-1);
const b = s.firstChild(a) !;
const b = (s as any).firstChild(a) !;
expect(b._urlSegment).toBe(url.root);
expect(b._lastPathIndex).toBe(-1);
const c = s.firstChild(b) !;
const c = (s as any).firstChild(b) !;
expect(c._urlSegment).toBe(url.root);
expect(c._lastPathIndex).toBe(-1);
});
@ -486,9 +493,9 @@ describe('recognize', () => {
]
}],
'a', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
const c = s.children(s.firstChild(s.root) !);
const c = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(c[0], '', {}, ComponentB);
checkActivatedRoute(c[1], '', {}, ComponentC, 'aux');
});
@ -505,9 +512,9 @@ describe('recognize', () => {
]
}],
'a', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
const c = s.children(s.firstChild(s.root) !);
const c = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(c[0], '', {}, ComponentB);
checkActivatedRoute(c[1], '', {}, ComponentC, 'aux');
});
@ -524,9 +531,9 @@ describe('recognize', () => {
]
}],
'a/(aux:c)', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
const c = s.children(s.firstChild(s.root) !);
const c = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(c[0], '', {}, ComponentB);
checkActivatedRoute(c[1], 'c', {}, ComponentC, 'aux');
});
@ -541,7 +548,7 @@ describe('recognize', () => {
'(aux:c)', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
const children = s.children(s.root);
const children = (s as any).children(s.root);
expect(children.length).toEqual(2);
checkActivatedRoute(children[0], '', {}, ComponentA);
checkActivatedRoute(children[1], 'c', {}, ComponentC, 'aux');
@ -566,13 +573,13 @@ describe('recognize', () => {
]
}],
'a/(d//aux:e)', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a', {}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a', {}, ComponentA);
const c = s.children(s.firstChild(s.root) !);
const c = (s as any).children((s as any).firstChild(s.root) !);
checkActivatedRoute(c[0], '', {}, ComponentB);
checkActivatedRoute(s.firstChild(c[0]) !, 'd', {}, ComponentD);
checkActivatedRoute((s as any).firstChild(c[0]) !, 'd', {}, ComponentD);
checkActivatedRoute(c[1], '', {}, ComponentC, 'aux');
checkActivatedRoute(s.firstChild(c[1]) !, 'e', {}, ComponentE);
checkActivatedRoute((s as any).firstChild(c[1]) !, 'e', {}, ComponentE);
});
});
});
@ -582,7 +589,7 @@ describe('recognize', () => {
it('should support simple wildcards', () => {
checkRecognize(
[{path: '**', component: ComponentA}], 'a/b/c/d;a1=11', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root) !, 'a/b/c/d', {a1: '11'}, ComponentA);
checkActivatedRoute((s as any).firstChild(s.root) !, 'a/b/c/d', {a1: '11'}, ComponentA);
});
});
});
@ -598,10 +605,10 @@ describe('recognize', () => {
]
}],
'p/11;pp=22/(a;pa=33//aux:b;pb=44)', (s: RouterStateSnapshot) => {
const p = s.firstChild(s.root) !;
const p = (s as any).firstChild(s.root) !;
checkActivatedRoute(p, 'p/11', {id: '11', pp: '22'}, undefined !);
const c = s.children(p);
const c = (s as any).children(p);
checkActivatedRoute(c[0], 'a', {id: '11', pp: '22', pa: '33'}, ComponentA);
checkActivatedRoute(c[1], 'b', {id: '11', pp: '22', pb: '44'}, ComponentB, 'aux');
});
@ -621,16 +628,16 @@ describe('recognize', () => {
}]
}],
'p/11/a/victor/b/c', (s: RouterStateSnapshot) => {
const p = s.firstChild(s.root) !;
const p = (s as any).firstChild(s.root) !;
checkActivatedRoute(p, 'p/11', {id: '11'}, undefined !);
const a = s.firstChild(p) !;
const a = (s as any).firstChild(p) !;
checkActivatedRoute(a, 'a/victor', {id: '11', name: 'victor'}, undefined !);
const b = s.firstChild(a) !;
const b = (s as any).firstChild(a) !;
checkActivatedRoute(b, 'b', {id: '11', name: 'victor'}, ComponentB);
const c = s.firstChild(b) !;
const c = (s as any).firstChild(b) !;
checkActivatedRoute(c, 'c', {}, ComponentC);
});
});
@ -648,7 +655,7 @@ describe('recognize', () => {
}]
}]
}],
'p/11/a/victor/b/c', (s: RouterStateSnapshot) => {
'p/11/a/victor/b/c', (s: any /* RouterStateSnapshot */) => {
const c = s.firstChild(s.firstChild(s.firstChild(s.firstChild(s.root) !) !) !) !;
checkActivatedRoute(c, 'c', {id: '11', name: 'victor'}, ComponentC);
}, 'always');
@ -660,7 +667,7 @@ describe('recognize', () => {
checkRecognize(
[{path: 'a', component: ComponentA, children: [{path: 'b', component: ComponentB}]}],
'/a', (s: RouterStateSnapshot) => {
const a = s.firstChild(s.root);
const a = (s as any).firstChild(s.root);
checkActivatedRoute(a !, 'a', {}, ComponentA);
});
});
@ -676,9 +683,9 @@ describe('recognize', () => {
]
}],
'/a', (s: RouterStateSnapshot) => {
const a = s.firstChild(s.root) !;
const a = (s as any).firstChild(s.root) !;
checkActivatedRoute(a, 'a', {}, ComponentA);
checkActivatedRoute(a.children[0], '', {}, ComponentC, 'aux');
checkActivatedRoute((a as any).children[0], '', {}, ComponentC, 'aux');
});
});
});
@ -700,9 +707,9 @@ describe('recognize', () => {
children: [{path: 'b', component: ComponentB}]
}] as any,
'/a/1;p=99/b', (s: RouterStateSnapshot) => {
const a = s.root.firstChild !;
const a = (s as any).root.firstChild !;
checkActivatedRoute(a, 'a/1', {id: '1', p: '99'}, ComponentA);
checkActivatedRoute(a.firstChild !, 'b', {}, ComponentB);
checkActivatedRoute((a as any).firstChild !, 'b', {}, ComponentB);
});
});
@ -710,7 +717,7 @@ describe('recognize', () => {
const matcher = (s: any, g: any, r: any) => s.length === 0 ? ({consumed: s}) : null;
checkRecognize([{matcher, component: ComponentA}] as any, '', (s: RouterStateSnapshot) => {
const a = s.root.firstChild !;
const a = (s as any).root.firstChild !;
checkActivatedRoute(a, '', {}, ComponentA);
});
});
@ -721,7 +728,7 @@ describe('recognize', () => {
checkRecognize(
[{path: 'a', component: ComponentA, children: [{matcher, component: ComponentB}]}] as any,
'a', (s: RouterStateSnapshot) => {
const a = s.root.firstChild !;
const a = (s as any).root.firstChild !;
checkActivatedRoute(a, 'a', {}, ComponentA);
});
});
@ -771,7 +778,7 @@ describe('recognize', () => {
function checkRecognize(
config: Routes, url: string, callback: any,
paramsInheritanceStrategy?: ParamsInheritanceStrategy): void {
paramsInheritanceStrategy?: 'emptyOnly' | 'always'): void {
recognize(RootComponent, config, tree(url), url, paramsInheritanceStrategy)
.subscribe(callback, e => { throw e; });
}