refactor: add types (#9116)

This commit is contained in:
Victor Berchet
2016-06-09 11:04:15 -07:00
committed by Miško Hevery
parent b60eecfc47
commit 7ce0fc7d47
64 changed files with 711 additions and 718 deletions

View File

@ -67,7 +67,7 @@ export function main() {
}
it('should generate absolute hrefs that include the base href',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
(<SpyLocation>location).setBaseHref('/my/base');
compile('<a href="hello" [routerLink]="[\'./User\']"></a>')
.then((_) => router.config(
@ -81,7 +81,7 @@ export function main() {
}));
it('should generate link hrefs without params', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should generate link hrefs without params', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile('<a href="hello" [routerLink]="[\'./User\']"></a>')
.then((_) => router.config(
[new Route({path: '/user', component: UserCmp, name: 'User'})]))
@ -94,7 +94,7 @@ export function main() {
}));
it('should generate link hrefs with params', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should generate link hrefs with params', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile('<a href="hello" [routerLink]="[\'./User\', {name: name}]">{{name}}</a>')
.then((_) => router.config(
[new Route({path: '/user/:name', component: UserCmp, name: 'User'})]))
@ -109,7 +109,7 @@ export function main() {
}));
it('should generate link hrefs from a child to its sibling',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then(
(_) => router.config(
@ -123,7 +123,7 @@ export function main() {
}));
it('should generate link hrefs from a child to its sibling with no leading slash',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then((_) => router.config([
new Route(
@ -138,7 +138,7 @@ export function main() {
}));
it('should generate link hrefs to a child with no leading slash',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then((_) => router.config([
new Route({path: '/book/:title/...', component: NoPrefixBookCmp, name: 'Book'})
@ -152,7 +152,7 @@ export function main() {
}));
it('should throw when links without a leading slash are ambiguous',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then((_) => router.config([
new Route({path: '/book/:title/...', component: AmbiguousBookCmp, name: 'Book'})
@ -168,7 +168,7 @@ export function main() {
}));
it('should generate link hrefs when asynchronously loaded',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then((_) => router.config([
new AsyncRoute({
@ -186,7 +186,7 @@ export function main() {
}));
it('should generate relative links preserving the existing parent route',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then((_) => router.config(
[new Route({path: '/book/:title/...', component: BookCmp, name: 'Book'})]))
@ -211,7 +211,7 @@ export function main() {
});
}));
it('should generate links to auxiliary routes', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should generate links to auxiliary routes', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile()
.then((_) => router.config([new Route({path: '/...', component: AuxLinkCmp})]))
.then((_) => router.navigateByUrl('/'))
@ -224,7 +224,7 @@ export function main() {
describe('router-link-active CSS class', () => {
it('should be added to the associated element', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should be added to the associated element', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
router.config([
new Route({path: '/child', component: HelloCmp, name: 'Child'}),
new Route({path: '/better-child', component: Hello2Cmp, name: 'BetterChild'})
@ -255,7 +255,7 @@ export function main() {
});
}));
it('should be added to links in child routes', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should be added to links in child routes', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
router.config([
new Route({path: '/child', component: HelloCmp, name: 'Child'}),
new Route({
@ -297,7 +297,7 @@ export function main() {
}));
it('should not be added to links in other child routes',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
router.config([
new Route({path: '/child', component: HelloCmp, name: 'Child'}),
new Route({
@ -351,7 +351,7 @@ export function main() {
return dispatchedEvent;
};
it('should navigate to link hrefs without params', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should navigate to link hrefs without params', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
compile('<a href="hello" [routerLink]="[\'./User\']"></a>')
.then((_) => router.config(
[new Route({path: '/user', component: UserCmp, name: 'User'})]))
@ -371,7 +371,7 @@ export function main() {
}));
it('should navigate to link hrefs in presence of base href',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
(<SpyLocation>location).setBaseHref('/base');
compile('<a href="hello" [routerLink]="[\'./User\']"></a>')
.then((_) => router.config(