export class TestComponentBuilder
export class TestComponentBuilder
exported from angular2/testing defined in angular2/src/testing/test_component_builder.ts (line 83)
Builds a ComponentFixture for use in component level tests.
Annotations
@Injectable()
@Injectable()
Constructor
constructor(_injector: Injector)
constructor(_injector: Injector)
Not Yet Documented
Members
overrideTemplate(componentType: Type, template: string) : TestComponentBuilder
overrideTemplate(componentType: Type, template: string) : TestComponentBuilder
Overrides only the html of a ComponentMetadata
.
All the other properties of the component's ViewMetadata
are preserved.
overrideView(componentType: Type, view: ViewMetadata) : TestComponentBuilder
overrideView(componentType: Type, view: ViewMetadata) : TestComponentBuilder
Overrides a component's ViewMetadata
.
overrideDirective(componentType: Type, from: Type, to: Type) : TestComponentBuilder
overrideDirective(componentType: Type, from: Type, to: Type) : TestComponentBuilder
Overrides the directives from the component ViewMetadata
.
overrideProviders(type: Type, providers: any[]) : TestComponentBuilder
overrideProviders(type: Type, providers: any[]) : TestComponentBuilder
Overrides one or more injectables configured via providers
metadata property of a directive
or
component.
Very useful when certain providers need to be mocked out.
The providers specified via this method are appended to the existing providers
causing the
duplicated providers to
be overridden.
overrideBindings(type: Type, providers: any[]) : TestComponentBuilder
overrideBindings(type: Type, providers: any[]) : TestComponentBuilder
Not Yet Documented
overrideViewProviders(type: Type, providers: any[]) : TestComponentBuilder
overrideViewProviders(type: Type, providers: any[]) : TestComponentBuilder
Overrides one or more injectables configured via providers
metadata property of a directive
or
component.
Very useful when certain providers need to be mocked out.
The providers specified via this method are appended to the existing providers
causing the
duplicated providers to
be overridden.
overrideViewBindings(type: Type, providers: any[]) : TestComponentBuilder
overrideViewBindings(type: Type, providers: any[]) : TestComponentBuilder
Not Yet Documented
createAsync(rootComponentType: Type) : Promise<ComponentFixture>
createAsync(rootComponentType: Type) : Promise<ComponentFixture>
Builds and returns a ComponentFixture.