TestBedStatic
interface
Static methods implemented by the TestBed
.
platform
PlatformRef
ngModule
Type<any> | Type<any>[]
initTestEnvironment
void
Initialize the environment for testing with a compiler factory, a PlatformRef, and an angular module. These are common to every test in the suite.
This may only be called once, to set up the common providers for the current test
suite on the current platform. If you absolutely need to change the providers,
first use resetTestEnvironment
.
Test modules and platforms for individual platforms are available from
'@angular/
@paramngModule
Type<any> | Type<any>[]
@paramplatform
PlatformRef
@returns
void
resetTestEnvironment
void
Reset the providers for the test injector.
@returns
void
configureCompiler
void
@paramconfig
{ providers?: any[] | undefined; useJit?: boolean | undefined; }
@returns
void
compileComponents
Promise<any>
@returns
Promise<any>
inject
T
@paramtoken
ProviderToken<T>
@paramnotFoundValue
undefined
@paramoptions
InjectOptions & { optional?: false | undefined; }
@returns
T
inject
T | null
@paramtoken
ProviderToken<T>
@paramnotFoundValue
null | undefined
@paramoptions
InjectOptions
@returns
T | null
inject
T
@paramtoken
ProviderToken<T>
@paramnotFoundValue
T | undefined
@paramoptions
InjectOptions | undefined
@returns
T
runInInjectionContext
T
execute
any
@paramtokens
any[]
@paramfn
Function
@paramcontext
any
@returns
any
overrideModule
TestBed
overrideComponent
TestBed
overrideDirective
TestBed
overridePipe
TestBed
overrideProvider
TestBed
Overwrites all providers for the given token with the given provider definition.
@paramtoken
any
@paramprovider
{ useFactory: Function; deps: any[]; multi?: boolean | undefined; }
@returns
TestBed
overrideProvider
TestBed
overrideProvider
TestBed
@paramtoken
any
@paramprovider
{ useFactory?: Function | undefined; useValue?: any; deps?: any[] | undefined; multi?: boolean | undefined; }
@returns
TestBed
overrideTemplateUsingTestingModule
TestBed
createComponent
ComponentFixture<T>
@paramcomponent
Type<T>
@returns
ComponentFixture<T>
flushEffects
void
Execute any pending effects.
@returns
void
Jump to details