angular / 14 / api / core / testing / testbedstatic.html

TestBedStatic

interface

Static methods implemented by the TestBed.

interface TestBedStatic extends TestBed {
  new (...args: any[]): TestBed

  // inherited from core/testing/TestBed
  platform: PlatformRef
  ngModule: Type<any> | Type<any>[]
  initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: TestEnvironmentOptions): void
  resetTestEnvironment(): void
  resetTestingModule(): TestBed
  configureCompiler(config: { providers?: any[]; useJit?: boolean; }): void
  configureTestingModule(moduleDef: TestModuleMetadata): TestBed
  compileComponents(): Promise<any>
  inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T
  get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any
  execute(tokens: any[], fn: Function, context?: any): any
  overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBed
  overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBed
  overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBed
  overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBed
  overrideTemplate(component: Type<any>, template: string): TestBed
  overrideProvider(token: any, provider: { useFactory: Function; deps: any[]; }): TestBed
  overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBed
  createComponent<T>(component: Type<T>): ComponentFixture<T>
}

Methods

new (...args: any[]): TestBed

Parameters
args any[]
Returns

TestBed

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v14.angular.io/api/core/testing/TestBedStatic