fix(typings): update test.typings for abstract superclasses

This commit is contained in:
Alex Eagle
2015-10-06 19:39:44 -07:00
committed by vsavkin
parent 6075509f26
commit 5458036de7
34 changed files with 122 additions and 71 deletions
@@ -11,9 +11,11 @@ import {
fakeAsync
} from 'angular2/test_lib';
import {ChangeDetectorRef} from 'angular2/src/core/change_detection/change_detector_ref';
import {
ChangeDetectorRef,
ChangeDetectorRef_
} from 'angular2/src/core/change_detection/change_detector_ref';
import {SpyChangeDetector} from '../spies';
import {ChangeDetectorRef_} from "../../../src/core/change_detection/change_detector_ref";
export function main() {
@@ -24,6 +24,7 @@ import {Compiler} from 'angular2/src/core/linker/compiler';
import {ProtoViewFactory} from 'angular2/src/core/linker/proto_view_factory';
import {reflector, ReflectionInfo} from 'angular2/src/core/reflection/reflection';
import {AppProtoView} from 'angular2/src/core/linker/view';
import {Compiler_} from "../../../src/core/linker/compiler";
export function main() {
describe('Compiler', () => {
@@ -36,7 +37,8 @@ export function main() {
protoViewFactorySpy = new SpyProtoViewFactory();
someProtoView = new AppProtoView(null, null, null, null, null, null);
protoViewFactorySpy.spy('createHost').andReturn(someProtoView);
return [bind(ProtoViewFactory).toValue(protoViewFactorySpy), Compiler];
return
[bind(ProtoViewFactory).toValue(protoViewFactorySpy), bind(Compiler).toClass(Compiler_)];
});
beforeEach(inject([Compiler], (_compiler) => {
@@ -40,12 +40,11 @@ import {
import {OnDestroy} from 'angular2/lifecycle_hooks';
import {bind, Injector, Binding, Optional, Inject, Injectable, Self, SkipSelf, InjectMetadata, Host, HostMetadata, SkipSelfMetadata} from 'angular2/core';
import {ViewContainerRef} from 'angular2/src/core/linker/view_container_ref';
import {TemplateRef} from 'angular2/src/core/linker/template_ref';
import {TemplateRef, TemplateRef_} from 'angular2/src/core/linker/template_ref';
import {ElementRef} from 'angular2/src/core/linker/element_ref';
import {DynamicChangeDetector, ChangeDetectorRef, Parser, Lexer} from 'angular2/src/core/change_detection/change_detection';
import {QueryList} from 'angular2/src/core/linker/query_list';
import {AppView, AppViewContainer} from "angular2/src/core/linker/view";
import {TemplateRef_} from "../../../src/core/linker/template_ref";
function createDummyView(detector = null): AppView {
var res = new SpyView();
@@ -82,7 +82,7 @@ import {
import {QueryList} from 'angular2/src/core/linker/query_list';
import {ViewContainerRef} from 'angular2/src/core/linker/view_container_ref';
import {ViewRef} from 'angular2/src/core/linker/view_ref';
import {ViewRef, ViewRef_} from 'angular2/src/core/linker/view_ref';
import {Compiler} from 'angular2/src/core/linker/compiler';
import {ElementRef} from 'angular2/src/core/linker/element_ref';
@@ -90,7 +90,7 @@ import {TemplateRef} from 'angular2/src/core/linker/template_ref';
import {DomRenderer} from 'angular2/src/core/render/dom/dom_renderer';
import {IS_DART} from '../../platform';
import {ViewRef_} from "../../../src/core/linker/view_ref";
import {Compiler_} from "../../../src/core/linker/compiler";
const ANCHOR_ELEMENT = CONST_EXPR(new OpaqueToken('AnchorElement'));
@@ -1020,7 +1020,7 @@ export function main() {
describe('dynamic ViewContainers', () => {
it('should allow to create a ViewContainerRef at any bound location',
inject([TestComponentBuilder, AsyncTestCompleter, Compiler],
inject([TestComponentBuilder, AsyncTestCompleter, bind(Compiler).toClass(Compiler_)],
(tcb: TestComponentBuilder, async, compiler) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div><dynamic-vp #dynamic></dynamic-vp></div>',
@@ -16,12 +16,9 @@ import {
import {SpyView, SpyAppViewManager} from '../spies';
import {AppView, AppViewContainer} from 'angular2/src/core/linker/view';
import {ViewContainerRef} from 'angular2/src/core/linker/view_container_ref';
import {ElementRef} from 'angular2/src/core/linker/element_ref';
import {ViewRef} from 'angular2/src/core/linker/view_ref';
import {ViewContainerRef_} from "../../../src/core/linker/view_container_ref";
import {ViewRef_} from "../../../src/core/linker/view_ref";
import {ElementRef_} from "../../../src/core/linker/element_ref";
import {ViewContainerRef, ViewContainerRef_} from 'angular2/src/core/linker/view_container_ref';
import {ElementRef, ElementRef_} from 'angular2/src/core/linker/element_ref';
import {ViewRef, ViewRef_} from 'angular2/src/core/linker/view_ref';
export function main() {
// TODO(tbosch): add missing tests
@@ -17,9 +17,15 @@ import {SpyRenderer, SpyAppViewPool, SpyAppViewListener, SpyProtoViewFactory} fr
import {Injector, bind} from 'angular2/core';
import {AppProtoView, AppView, AppViewContainer, ViewType} from 'angular2/src/core/linker/view';
import {ProtoViewRef, ViewRef, internalView} from 'angular2/src/core/linker/view_ref';
import {
ProtoViewRef,
ProtoViewRef_,
ViewRef,
ViewRef_,
internalView
} from 'angular2/src/core/linker/view_ref';
import {ElementRef} from 'angular2/src/core/linker/element_ref';
import {TemplateRef} from 'angular2/src/core/linker/template_ref';
import {TemplateRef, TemplateRef_} from 'angular2/src/core/linker/template_ref';
import {
Renderer,
RenderViewRef,
@@ -27,7 +33,7 @@ import {
RenderFragmentRef,
RenderViewWithFragments
} from 'angular2/src/core/render/api';
import {AppViewManager} from 'angular2/src/core/linker/view_manager';
import {AppViewManager, AppViewManager_} from 'angular2/src/core/linker/view_manager';
import {AppViewManagerUtils} from 'angular2/src/core/linker/view_manager_utils';
import {
@@ -38,10 +44,6 @@ import {
createNestedElBinder,
createProtoElInjector
} from './view_manager_utils_spec';
import {ProtoViewRef_} from "../../../src/core/linker/view_ref";
import {ViewRef_} from "../../../src/core/linker/view_ref";
import {AppViewManager_} from "../../../src/core/linker/view_manager";
import {TemplateRef_} from "../../../src/core/linker/template_ref";
export function main() {
// TODO(tbosch): add missing tests
@@ -14,10 +14,9 @@ import {
EventManagerPlugin,
DomEventsPlugin
} from 'angular2/src/core/render/dom/events/event_manager';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone';
import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection';
import {DOM} from 'angular2/src/core/dom/dom_adapter';
import {NgZone_} from "../../../../../src/core/zone/ng_zone";
export function main() {
var domEventPlugin;
+15 -1
View File
@@ -53,7 +53,21 @@ export class SpyAppViewManager extends SpyObject {
}
export class SpyRenderer extends SpyObject {
constructor() { super(Renderer); }
constructor() {
// Note: Renderer is an abstract class,
// so we can't generates spy functions automatically
// by inspecting the prototype...
super(Renderer);
this.spy('setEventDispatcher');
this.spy('destroyView');
this.spy('createView');
this.spy('createProtoView');
this.spy('hydrateView');
this.spy('dehydrateView');
this.spy('attachFragmentAfterElement');
this.spy('attachFragmentAfterFragment');
this.spy('detachFragment');
}
}
export class SpyAppViewPool extends SpyObject {
@@ -12,10 +12,9 @@ import {
SpyObject
} from 'angular2/test_lib';
import {Testability} from 'angular2/src/core/testability/testability';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone';
import {normalizeBlank} from 'angular2/src/core/facade/lang';
import {PromiseWrapper} from 'angular2/src/core/facade/async';
import {NgZone_} from "../../../src/core/zone/ng_zone";
// Schedules a microtasks (using a resolved promise .then())
function microTask(fn: Function): void {
@@ -17,8 +17,7 @@ import {
import {PromiseCompleter, PromiseWrapper, TimerWrapper} from 'angular2/src/core/facade/async';
import {BaseException} from 'angular2/src/core/facade/exceptions';
import {NgZone} from 'angular2/src/core/zone/ng_zone';
import {NgZone_} from "../../../src/core/zone/ng_zone";
import {NgZone, NgZone_} from 'angular2/src/core/zone/ng_zone';
var needsLongerTimers = browserDetection.isSlow || browserDetection.isEdge;
var resultTimer = 1000;
@@ -13,7 +13,11 @@ import {
} from 'angular2/test_lib';
import {ObservableWrapper} from 'angular2/src/core/facade/async';
import {BrowserJsonp} from 'angular2/src/http/backends/browser_jsonp';
import {JSONPConnection, JSONPBackend} from 'angular2/src/http/backends/jsonp_backend';
import {
JSONPConnection,
JSONPConnection_,
JSONPBackend
} from 'angular2/src/http/backends/jsonp_backend';
import {bind, Injector} from 'angular2/core';
import {isPresent, StringWrapper} from 'angular2/src/core/facade/lang';
import {TimerWrapper} from 'angular2/src/core/facade/async';
@@ -23,7 +27,6 @@ import {Map} from 'angular2/src/core/facade/collection';
import {RequestOptions, BaseRequestOptions} from 'angular2/src/http/base_request_options';
import {BaseResponseOptions, ResponseOptions} from 'angular2/src/http/base_response_options';
import {ResponseTypes, ReadyStates, RequestMethods} from 'angular2/src/http/enums';
import {JSONPConnection_} from "../../../src/http/backends/jsonp_backend";
var addEventListenerSpy;
var existingScripts = [];
@@ -7,12 +7,11 @@ import {
it,
expect
} from "angular2/test_lib";
import {RenderProtoViewRef} from "angular2/src/core/render/api";
import {RenderProtoViewRef, RenderProtoViewRef_} from "angular2/src/core/render/api";
import {RenderProtoViewRefStore} from "angular2/src/web_workers/shared/render_proto_view_ref_store";
import {
WebWorkerRenderProtoViewRef
} from "angular2/src/web_workers/shared/render_proto_view_ref_store";
import {RenderProtoViewRef_} from "../../../src/core/render/api";
export function main() {
describe("RenderProtoViewRefStore", () => {
@@ -12,7 +12,10 @@ import {
} from 'angular2/test_lib';
import {createPairedMessageBuses} from '../shared/web_worker_test_util';
import {Serializer, PRIMITIVE} from 'angular2/src/web_workers/shared/serializer';
import {ServiceMessageBroker} from 'angular2/src/web_workers/shared/service_message_broker';
import {
ServiceMessageBroker,
ServiceMessageBroker_
} from 'angular2/src/web_workers/shared/service_message_broker';
import {ObservableWrapper, PromiseWrapper} from 'angular2/src/core/facade/async';
import {bind} from 'angular2/core';
import {ON_WEB_WORKER} from 'angular2/src/web_workers/shared/api';
@@ -20,7 +23,6 @@ import {RenderProtoViewRefStore} from 'angular2/src/web_workers/shared/render_pr
import {
RenderViewWithFragmentsStore
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
import {ServiceMessageBroker_} from "../../../src/web_workers/shared/service_message_broker";
export function main() {
const CHANNEL = "UIMessageBroker Test Channel";
@@ -26,6 +26,7 @@ import {
import {WebWorkerRenderer} from "angular2/src/web_workers/worker/renderer";
import {
ClientMessageBrokerFactory,
ClientMessageBrokerFactory_,
UiArguments,
FnArg
} from "angular2/src/web_workers/shared/client_message_broker";
@@ -50,10 +51,11 @@ import {
import {WebWorkerApplication} from 'angular2/src/web_workers/ui/impl';
import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer';
import {createPairedMessageBuses, PairedMessageBuses} from '../shared/web_worker_test_util';
import {ServiceMessageBrokerFactory} from 'angular2/src/web_workers/shared/service_message_broker';
import {
ServiceMessageBrokerFactory,
ServiceMessageBrokerFactory_
} from 'angular2/src/web_workers/shared/service_message_broker';
import {WebWorkerEventDispatcher} from 'angular2/src/web_workers/worker/event_dispatcher';
import {ServiceMessageBrokerFactory_} from "../../../src/web_workers/shared/service_message_broker";
import {ClientMessageBrokerFactory_} from "../../../src/web_workers/shared/client_message_broker";
export function main() {
@@ -13,11 +13,11 @@ import {Type} from 'angular2/src/core/facade/lang';
import {
ClientMessageBroker,
UiArguments,
ClientMessageBrokerFactory
ClientMessageBrokerFactory,
ClientMessageBrokerFactory_
} from 'angular2/src/web_workers/shared/client_message_broker';
import {WebWorkerXHRImpl} from "angular2/src/web_workers/worker/xhr_impl";
import {PromiseWrapper} from "angular2/src/core/facade/async";
import {ClientMessageBrokerFactory_} from "../../../src/web_workers/shared/client_message_broker";
export function main() {
describe("WebWorkerXHRImpl", () => {