TestBed

Stable

Class

What it does

Configures and initializes environment for unit testing and provides methods for creating components and services in unit tests.

Class Overview

class TestBed implements Injector {
static initTestEnvironment(ngModule: Type<any>, platform: PlatformRef) : TestBed
static resetTestEnvironment()
static resetTestingModule() : typeof TestBed
static configureCompiler(config: {providers?: any[]; useJit?: boolean;}) : typeof TestBed
static configureTestingModule(moduleDef: TestModuleMetadata) : typeof TestBed
static compileComponents() : Promise<any>
static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>) : typeof TestBed
static overrideComponent(component: Type<any>, override: MetadataOverride<Component>) : typeof TestBed
static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>) : typeof TestBed
static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>) : typeof TestBed
static get(token: any, notFoundValue?: any)
static createComponent(component: Type<T>) : ComponentFixture<T>
initTestEnvironment(ngModule: Type<any>, platform: PlatformRef)
resetTestEnvironment()
resetTestingModule()
platform : PlatformRef
ngModule : Type<any>
configureCompiler(config: {providers?: any[], useJit?: boolean})
configureTestingModule(moduleDef: TestModuleMetadata)
compileComponents() : Promise<any>
get(token: any, notFoundValue?: any)
execute(tokens: any[], fn: Function, context?: any) : any
overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>) : void
overrideComponent(component: Type<any>, override: MetadataOverride<Component>) : void
overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>) : void
overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>) : void
createComponent(component: Type<T>) : ComponentFixture<T>

}

Class Description

Static Members

Class Details

exported from @angular/core/testing/index, defined in @angular/core/testing/test_bed.ts