Skip to content

Commit 34deda5

Browse files
committed
fix(test_lib): add missing types
1 parent f6108c5 commit 34deda5

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

modules/angular2/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ export {ComponentRef} from 'angular2/src/core/compiler/dynamic_component_loader'
2828

2929
export {NgZone} from 'angular2/src/core/zone/ng_zone';
3030
export {Observable, EventEmitter} from 'angular2/src/core/facade/async';
31+
export {Predicate} from 'angular2/src/core/facade/collection';

modules/angular2/src/core/debug/debug_element.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ export class DebugElement {
137137
}
138138
}
139139

140+
/**
141+
* Returns a DebugElement for a ElementRef.
142+
*
143+
* @param {ElementRef}: elementRef
144+
* @return {DebugElement}
145+
*/
140146
export function inspectElement(elementRef: ElementRef): DebugElement {
141147
return DebugElement.create(elementRef);
142148
}

modules/angular2/src/core/debug/debug_element_view_listener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class DebugElementViewListener implements AppViewListener {
6868
}
6969
}
7070

71-
export const ELEMENT_PROBE_BINDINGS = CONST_EXPR([
71+
export const ELEMENT_PROBE_BINDINGS: any[] = CONST_EXPR([
7272
DebugElementViewListener,
7373
CONST_EXPR(new Binding(AppViewListener, {toAlias: DebugElementViewListener})),
7474
]);

modules/angular2/src/test_lib/fake_async.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function fakeAsync(fn: Function): Function {
6565
}
6666

6767
// TODO we should fix tick to dequeue the failed timer instead of relying on clearPendingTimers
68-
export function clearPendingTimers() {
68+
export function clearPendingTimers(): void {
6969
ListWrapper.clear(_microtasks);
7070
ListWrapper.clear(_pendingPeriodicTimers);
7171
ListWrapper.clear(_pendingTimers);

modules/angular2/src/test_lib/test_lib.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export var proxy: ClassDecorator = (t) => t;
1616

1717
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);
1818

19-
export var afterEach = _global.afterEach;
19+
export var afterEach: Function = _global.afterEach;
2020

21-
type SyncTestFn = () => void;
21+
export type SyncTestFn = () => void;
2222
type AsyncTestFn = (done: () => void) => void;
2323
type AnyTestFn = SyncTestFn | AsyncTestFn;
2424

@@ -88,19 +88,19 @@ function _describe(jsmFn, ...args) {
8888
return suite;
8989
}
9090

91-
export function describe(...args) {
91+
export function describe(...args): void {
9292
return _describe(jsmDescribe, ...args);
9393
}
9494

95-
export function ddescribe(...args) {
95+
export function ddescribe(...args): void {
9696
return _describe(jsmDDescribe, ...args);
9797
}
9898

99-
export function xdescribe(...args) {
99+
export function xdescribe(...args): void {
100100
return _describe(jsmXDescribe, ...args);
101101
}
102102

103-
export function beforeEach(fn: FunctionWithParamTokens | SyncTestFn) {
103+
export function beforeEach(fn: FunctionWithParamTokens | SyncTestFn): void {
104104
if (runnerStack.length > 0) {
105105
// Inside a describe block, beforeEach() uses a BeforeEachRunner
106106
runnerStack[runnerStack.length - 1].beforeEach(fn);
@@ -122,7 +122,7 @@ export function beforeEach(fn: FunctionWithParamTokens | SyncTestFn) {
122122
* bind(SomeToken).toValue(myValue),
123123
* ]);
124124
*/
125-
export function beforeEachBindings(fn) {
125+
export function beforeEachBindings(fn): void {
126126
jsmBeforeEach(() => {
127127
var bindings = fn();
128128
if (!bindings) return;
@@ -131,7 +131,7 @@ export function beforeEachBindings(fn) {
131131
}
132132

133133
function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | AnyTestFn,
134-
timeOut: number) {
134+
timeOut: number): void {
135135
var runner = runnerStack[runnerStack.length - 1];
136136

137137
if (testFn instanceof FunctionWithParamTokens) {
@@ -183,15 +183,15 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
183183
}
184184
}
185185

186-
export function it(name, fn, timeOut = null) {
186+
export function it(name, fn, timeOut = null): void {
187187
return _it(jsmIt, name, fn, timeOut);
188188
}
189189

190-
export function xit(name, fn, timeOut = null) {
190+
export function xit(name, fn, timeOut = null): void {
191191
return _it(jsmXIt, name, fn, timeOut);
192192
}
193193

194-
export function iit(name, fn, timeOut = null) {
194+
export function iit(name, fn, timeOut = null): void {
195195
return _it(jsmIIt, name, fn, timeOut);
196196
}
197197

modules/angular2/src/test_lib/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export class BrowserDetection {
5858
return this._ua.indexOf('Chrome/4') > -1 && this._ua.indexOf('Edge') == -1;
5959
}
6060
}
61-
export var browserDetection = new BrowserDetection(null);
61+
export var browserDetection: BrowserDetection = new BrowserDetection(null);
6262

63-
export function dispatchEvent(element, eventType) {
63+
export function dispatchEvent(element, eventType): void {
6464
DOM.dispatchEvent(element, DOM.createEvent(eventType));
6565
}
6666

0 commit comments

Comments
 (0)