refactor(testing): remove deprecated testing functions (#10832)
Remove TestComponentBuilder, addProviders, and withProviders. These were deprecated in rc5 - see the changelog for update information. Note - this does not actually remove the functions, but makes them internal only. They will be removed from the codebase entirely at a later time.
This commit is contained in:
parent
6b26102931
commit
4c9900dc3a
|
@ -13,3 +13,6 @@ export var TestingCompiler: typeof t.TestingCompiler = r.TestingCompiler;
|
|||
|
||||
export type TestingCompilerFactory = t.TestingCompilerFactory;
|
||||
export var TestingCompilerFactory: typeof t.TestingCompilerFactory = r.TestingCompilerFactory;
|
||||
|
||||
export type TestComponentBuilder = t.TestComponentBuilder;
|
||||
export var TestComponentBuilder: typeof t.TestComponentBuilder = r.TestComponentBuilder;
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
import {DirectiveResolver, XHR, i18n} from '@angular/compiler';
|
||||
import {MockDirectiveResolver} from '@angular/compiler/testing';
|
||||
import {Compiler, Component, DebugElement, Injector, TRANSLATIONS} from '@angular/core';
|
||||
import {TestBed, TestComponentBuilder, fakeAsync} from '@angular/core/testing';
|
||||
import {TestBed, fakeAsync} from '@angular/core/testing';
|
||||
|
||||
import {beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit,} from '@angular/core/testing/testing_internal';
|
||||
import {beforeEach, TestComponentBuilder, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit,} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {SpyXHR} from '../spies';
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
import {DirectiveResolver, XHR} from '@angular/compiler';
|
||||
import {MockDirectiveResolver} from '@angular/compiler/testing';
|
||||
import {Compiler, Component, ComponentFactory, Injectable, Injector, Input, NgModule, NgModuleFactory, Type, ViewMetadata} from '@angular/core';
|
||||
import {ComponentFixture, TestBed, TestComponentBuilder, fakeAsync, tick} from '@angular/core/testing';
|
||||
import {beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing';
|
||||
import {TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
import {stringify} from '../src/facade/lang';
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {NgIf} from '@angular/common';
|
||||
import {Component, Injectable, Input, NgModule, Pipe, ViewMetadata} from '@angular/core';
|
||||
import {ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, TestComponentBuilder, withProviders} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, withModule} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {dispatchEvent} from '@angular/platform-browser/testing/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
|
@ -345,7 +345,7 @@ export function main() {
|
|||
}));
|
||||
|
||||
it('should auto detect changes if ComponentFixtureAutoDetect is provided as true',
|
||||
withProviders(() => [{provide: ComponentFixtureAutoDetect, useValue: true}])
|
||||
withModule({providers: [{provide: ComponentFixtureAutoDetect, useValue: true}]})
|
||||
.inject(
|
||||
[TestComponentBuilder, AsyncTestCompleter],
|
||||
(tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
*/
|
||||
|
||||
import {AnimationEntryMetadata, Compiler, ComponentFactory, Inject, Injectable, Injector, NgZone, Type, ViewMetadata} from '@angular/core';
|
||||
import {ComponentFixture, ComponentFixtureNoNgZone, TestBed, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {ComponentFixture, ComponentFixtureNoNgZone, TestBed} from '@angular/core/testing';
|
||||
import {TestComponentBuilder} from '../core_private_testing';
|
||||
|
||||
import {DirectiveResolver} from '../index';
|
||||
import {MapWrapper} from '../src/facade/collection';
|
||||
|
|
|
@ -7,15 +7,19 @@
|
|||
*/
|
||||
|
||||
import * as test_compiler from './testing/test_compiler';
|
||||
import * as test_component_builder from './testing/test_component_builder';
|
||||
|
||||
export declare namespace __core_private_testing_types__ {
|
||||
export type TestingCompiler = test_compiler.TestingCompiler;
|
||||
export var TestingCompiler: typeof test_compiler.TestingCompiler;
|
||||
export type TestingCompilerFactory = test_compiler.TestingCompilerFactory;
|
||||
export var TestingCompilerFactory: typeof test_compiler.TestingCompilerFactory;
|
||||
export type TestComponentBuilder = test_component_builder.TestComponentBuilder;
|
||||
export var TestComponentBuilder: typeof test_component_builder.TestComponentBuilder;
|
||||
}
|
||||
|
||||
export var __core_private_testing__ = {
|
||||
TestingCompiler: test_compiler.TestingCompiler,
|
||||
TestingCompilerFactory: test_compiler.TestingCompilerFactory
|
||||
TestingCompilerFactory: test_compiler.TestingCompilerFactory,
|
||||
TestComponentBuilder: test_component_builder.TestComponentBuilder
|
||||
};
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
*/
|
||||
|
||||
import {NgIf} from '@angular/common';
|
||||
import {TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AnimationDriver} from '@angular/platform-browser/src/dom/animation_driver';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {MockAnimationDriver} from '@angular/platform-browser/testing/mock_animation_driver';
|
||||
|
@ -22,7 +21,7 @@ import {AUTO_STYLE, AnimationEntryMetadata, animate, group, keyframes, sequence,
|
|||
import {isArray, isPresent} from '../../src/facade/lang';
|
||||
import {TestBed, fakeAsync, flushMicrotasks, tick} from '../../testing';
|
||||
import {MockAnimationPlayer} from '../../testing/mock_animation_player';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../../testing/testing_internal';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../../testing/testing_internal';
|
||||
|
||||
export function main() {
|
||||
describe('jit', () => { declareTests({useJit: true}); });
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
import {NgFor, NgIf} from '@angular/common';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Component, Directive, Input} from '@angular/core/src/metadata';
|
||||
import {TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnInit} from '@angular/core';
|
||||
import {Component, Directive, ViewMetadata} from '@angular/core/src/metadata';
|
||||
import {TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, Log, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, Log, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
|
||||
export function main() {
|
||||
describe('directive lifecycle integration spec', () => {
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
import {NgFor} from '@angular/common';
|
||||
import {Component, ContentChildren, Directive, Inject, QueryList, asNativeElements, forwardRef} from '@angular/core';
|
||||
import {TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -12,8 +12,8 @@ import {TEST_COMPILER_PROVIDERS} from '@angular/compiler/test/test_bindings';
|
|||
import {MockSchemaRegistry} from '@angular/compiler/testing';
|
||||
import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, DebugElement, Directive, DoCheck, Injectable, Input, OnChanges, OnDestroy, OnInit, Output, Pipe, PipeTransform, RenderComponentType, Renderer, RootRenderer, SimpleChange, SimpleChanges, TemplateRef, Type, ViewContainerRef, ViewMetadata, WrappedValue, forwardRef} from '@angular/core';
|
||||
import {DebugDomRenderer} from '@angular/core/src/debug/debug_renderer';
|
||||
import {ComponentFixture, TestBed, TestComponentBuilder, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixture, TestBed, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {TestComponentBuilder, afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {DomRootRenderer} from '@angular/platform-browser/src/dom/dom_renderer';
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import {ANALYZE_FOR_ENTRY_COMPONENTS, Component, ComponentFactoryResolver, NoComponentFactoryError, ViewMetadata, forwardRef} from '@angular/core';
|
||||
import {TestBed, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {Console} from '../../src/console';
|
||||
import {stringify} from '../../src/facade/lang';
|
||||
|
|
|
@ -18,8 +18,8 @@ import {ViewContainerRef} from '@angular/core/src/linker/view_container_ref';
|
|||
import {EmbeddedViewRef} from '@angular/core/src/linker/view_ref';
|
||||
import {Attribute, Component, ContentChildren, Directive, HostBinding, HostListener, Input, Output, Pipe, ViewMetadata} from '@angular/core/src/metadata';
|
||||
import {Renderer} from '@angular/core/src/render';
|
||||
import {ComponentFixture, TestBed, TestComponentBuilder, fakeAsync, tick} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixture, TestBed, fakeAsync, tick} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {dispatchEvent, el} from '@angular/platform-browser/testing/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {NgIf} from '@angular/common';
|
||||
import {AfterContentInit, AfterViewInit, Component, ContentChildren, Directive, Input, QueryList, ViewChildren} from '@angular/core';
|
||||
import {TestBed, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {Component, Directive, ElementRef, TemplateRef, ViewContainerRef, ViewEncapsulation, ViewMetadata, forwardRef} from '@angular/core';
|
||||
import {getAllDebugNodes} from '@angular/core/src/debug/debug_node';
|
||||
import {ComponentFixture, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixture} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
import {NgFor, NgIf} from '@angular/common';
|
||||
import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, Component, ContentChild, ContentChildren, Directive, QueryList, TemplateRef, ViewChild, ViewChildren, ViewContainerRef, asNativeElements} from '@angular/core';
|
||||
import {TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
import {isPresent, stringify} from '../../src/facade/lang';
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {NgClass, NgIf} from '@angular/common';
|
||||
import {Component, Injector, OpaqueToken, Pipe, PipeTransform, ViewMetadata, forwardRef} from '@angular/core';
|
||||
import {TestBed, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import {Component} from '@angular/core/src/metadata';
|
||||
import {TestBed, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {DomSanitizationService} from '@angular/platform-browser/src/security/dom_sanitization_service';
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {NgFor, NgIf} from '@angular/common';
|
||||
import {Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, DebugElement, Directive, ElementRef, Host, Inject, InjectMetadata, Input, Optional, Pipe, PipeTransform, Self, SkipSelfMetadata, TemplateRef, Type, ViewContainerRef, ViewMetadata, forwardRef} from '@angular/core';
|
||||
import {ComponentFixture, TestComponentBuilder, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixture, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
*/
|
||||
|
||||
import {Component, Directive, ElementRef, Input, QueryList, ViewChild, ViewChildren, ViewMetadata} from '@angular/core';
|
||||
import {TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
|
||||
export function main() {
|
||||
describe('ViewChild', () => {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
export * from './testing/async';
|
||||
export * from './testing/component_fixture';
|
||||
export * from './testing/fake_async';
|
||||
export * from './testing/test_component_builder';
|
||||
export * from './testing/test_bed';
|
||||
export * from './testing/testing';
|
||||
export * from './testing/metadata_override';
|
||||
|
|
|
@ -429,13 +429,6 @@ export class InjectSetupWrapper {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `TestBed.configureTestingModule instead.
|
||||
*/
|
||||
export function withProviders(providers: () => any) {
|
||||
return new InjectSetupWrapper(() => { return {providers: providers()}; });
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
|
|
|
@ -27,13 +27,6 @@ if (_global.beforeEach) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows overriding default providers of the test injector,
|
||||
* which are defined in test_injector.js
|
||||
*
|
||||
* @deprecated Use `TestBed.configureTestingModule instead.
|
||||
*/
|
||||
export function addProviders(providers: Array<any>): void {
|
||||
if (!providers) return;
|
||||
TestBed.configureTestingModule({providers: providers});
|
||||
}
|
||||
// TODO(juliemr): remove this, only used because we need to export something to have compilation
|
||||
// work.
|
||||
export var __core_private_testing_placeholder__ = '';
|
||||
|
|
|
@ -10,7 +10,7 @@ import {StringMapWrapper} from '../src/facade/collection';
|
|||
import {Math, global, isFunction, isPromise} from '../src/facade/lang';
|
||||
|
||||
import {AsyncTestCompleter} from './async_test_completer';
|
||||
import {getTestBed, inject} from './test_bed';
|
||||
import {TestBed, getTestBed, inject} from './test_bed';
|
||||
|
||||
export {AsyncTestCompleter} from './async_test_completer';
|
||||
export {MockAnimationPlayer} from './mock_animation_player';
|
||||
|
@ -18,6 +18,7 @@ export {inject} from './test_bed';
|
|||
export * from './logger';
|
||||
export * from './ng_zone_mock';
|
||||
export * from './mock_application_ref';
|
||||
export * from './test_component_builder';
|
||||
|
||||
export var proxy: ClassDecorator = (t: any /** TODO #9100 */) => t;
|
||||
|
||||
|
@ -113,6 +114,18 @@ export function beforeEachProviders(fn: any /** TODO #9100 */): void {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows overriding default providers of the test injector,
|
||||
* which are defined in test_injector.js
|
||||
*
|
||||
* @deprecated Use `TestBed.configureTestingModule instead.
|
||||
*/
|
||||
export function addProviders(providers: Array<any>): void {
|
||||
if (!providers) return;
|
||||
TestBed.configureTestingModule({providers: providers});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {NgFor, NgIf} from '@angular/common';
|
||||
import {Component, Directive, EventEmitter, Input, Output, forwardRef} from '@angular/core';
|
||||
import {ComponentFixture, TestBed, TestComponentBuilder, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, afterEach, beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ComponentFixture, TestBed, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, afterEach, beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {ControlValueAccessor, FormArray, FormControl, FormGroup, FormsModule, NG_ASYNC_VALIDATORS, NG_VALIDATORS, NgControl, ReactiveFormsModule, Validator, Validators} from '@angular/forms';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import {UrlResolver, XHR} from '@angular/compiler';
|
||||
import {BaseException, Component} from '@angular/core';
|
||||
import {TestBed, TestComponentBuilder, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {TestBed, fakeAsync, flushMicrotasks, tick} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
import {CachedXHR} from '../../src/xhr/xhr_cache';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import {OverridingTestComponentBuilder, platformCoreDynamicTesting} from '@angular/compiler/testing';
|
||||
import {NgModule, PlatformRef, createPlatformFactory} from '@angular/core';
|
||||
import {TestComponentBuilder, TestComponentRenderer} from '@angular/core/testing';
|
||||
import {TestComponentRenderer, __core_private_testing__ as r, __core_private_testing_types__ as t} from '@angular/core/testing';
|
||||
import {BrowserTestingModule} from '@angular/platform-browser/testing';
|
||||
|
||||
import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './src/platform_providers';
|
||||
|
@ -31,7 +31,7 @@ export const platformBrowserDynamicTesting = createPlatformFactory(
|
|||
@NgModule({
|
||||
exports: [BrowserTestingModule],
|
||||
providers: [
|
||||
{provide: TestComponentBuilder, useClass: OverridingTestComponentBuilder},
|
||||
{provide: r.TestComponentBuilder, useClass: OverridingTestComponentBuilder},
|
||||
{provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},
|
||||
]
|
||||
})
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {NgZone} from '@angular/core';
|
||||
import {withProviders} from '@angular/core/testing/test_bed';
|
||||
import {withModule} from '@angular/core/testing/test_bed';
|
||||
import {AsyncTestCompleter, MockNgZone, beforeEach, beforeEachProviders, describe, expect, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus';
|
||||
|
||||
|
@ -118,7 +118,7 @@ export function main() {
|
|||
function flushMessages(fn: () => void) { setTimeout(fn, 50); }
|
||||
|
||||
it('should buffer messages and wait for the zone to exit before sending',
|
||||
withProviders(() => [{provide: NgZone, useClass: MockNgZone}])
|
||||
withModule({providers: [{provide: NgZone, useClass: MockNgZone}]})
|
||||
.inject(
|
||||
[AsyncTestCompleter, NgZone],
|
||||
(async: AsyncTestCompleter, zone: MockNgZone) => {
|
||||
|
|
|
@ -10,8 +10,8 @@ import {NgIf} from '@angular/common';
|
|||
import {Component, ComponentRef, Injectable, Injector, ReflectiveInjector, ViewMetadata, getPlatform} from '@angular/core';
|
||||
import {DebugDomRootRenderer} from '@angular/core/src/debug/debug_renderer';
|
||||
import {RootRenderer} from '@angular/core/src/render/api';
|
||||
import {TestBed, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, TestComponentBuilder, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {DomRootRenderer, DomRootRenderer_} from '@angular/platform-browser/src/dom/dom_renderer';
|
||||
|
|
|
@ -10,7 +10,8 @@ import 'rxjs/add/operator/map';
|
|||
|
||||
import {Location} from '@angular/common';
|
||||
import {Component, NgModule, NgModuleFactoryLoader} from '@angular/core';
|
||||
import {ComponentFixture, TestBed, TestComponentBuilder, addProviders, fakeAsync, inject, tick} from '@angular/core/testing';
|
||||
import {ComponentFixture, TestBed, fakeAsync, inject, tick} from '@angular/core/testing';
|
||||
import {TestComponentBuilder, addProviders} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {of } from 'rxjs/observable/of';
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/** @deprecated */
|
||||
export declare function addProviders(providers: Array<any>): void;
|
||||
|
||||
/** @stable */
|
||||
export declare function async(fn: Function): (done: any) => any;
|
||||
|
||||
|
@ -95,22 +92,6 @@ export declare class TestBed implements Injector {
|
|||
static resetTestingModule(): typeof TestBed;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export declare class TestComponentBuilder {
|
||||
protected _injector: Injector;
|
||||
constructor(_injector: Injector);
|
||||
createAsync<T>(rootComponentType: Type<T>): Promise<ComponentFixture<T>>;
|
||||
createFakeAsync<T>(rootComponentType: Type<T>): ComponentFixture<T>;
|
||||
protected createFromFactory<C>(ngZone: NgZone, componentFactory: ComponentFactory<C>): ComponentFixture<C>;
|
||||
createSync<T>(rootComponentType: Type<T>): ComponentFixture<T>;
|
||||
overrideAnimations(componentType: Type<any>, animations: AnimationEntryMetadata[]): TestComponentBuilder;
|
||||
overrideDirective(componentType: Type<any>, from: Type<any>, to: Type<any>): TestComponentBuilder;
|
||||
overrideProviders(type: Type<any>, providers: any[]): TestComponentBuilder;
|
||||
overrideTemplate(componentType: Type<any>, template: string): TestComponentBuilder;
|
||||
overrideView(componentType: Type<any>, view: ViewMetadata): TestComponentBuilder;
|
||||
overrideViewProviders(type: Type<any>, providers: any[]): TestComponentBuilder;
|
||||
}
|
||||
|
||||
/** @experimental */
|
||||
export declare class TestComponentRenderer {
|
||||
insertRootElement(rootElementId: string): void;
|
||||
|
@ -129,6 +110,3 @@ export declare function tick(millis?: number): void;
|
|||
|
||||
/** @experimental */
|
||||
export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
|
||||
|
||||
/** @deprecated */
|
||||
export declare function withProviders(providers: () => any): InjectSetupWrapper;
|
||||
|
|
Loading…
Reference in New Issue