TestBedStatic
interface
Static methods implemented by the TestBed
.
platform
PlatformRef
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/
@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
@paramnotFoundValue
undefined
@returns
T
inject
T | null
@paramnotFoundValue
null | undefined
@returns
T | null
inject
T
@paramnotFoundValue
T | undefined
@returns
T
inject
T
@paramnotFoundValue
T | undefined
@returns
T
inject
T | null
@paramnotFoundValue
null
@returns
T | null
get
any
@paramnotFoundValue
T | undefined
@returns
any
get
any
@paramtoken
any
@paramnotFoundValue
any
@returns
any
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>
@returns
ComponentFixture<T>
flushEffects
void
Execute any pending effects.
@returns
void
Jump to details