fork<E extends T> method

NgTestBed<E> fork<E extends T>({
  1. Element? host,
  2. ComponentFactory<E>? component,
  3. Iterable<Object>? providers,
  4. InjectorFactory? rootInjector,
  5. NgTestStabilizerFactory? stabilizer,
})

Creates a new instance of NgTestBed.

Any non-null value overrides the existing properties.

Implementation

NgTestBed<E> fork<E extends T>({
  Element? host,
  ComponentFactory<E>? component,
  Iterable<Object>? providers,
  InjectorFactory? rootInjector,
  NgTestStabilizerFactory? stabilizer,
}) {
  return NgTestBed<E>._(
    host: host ?? _host,
    providers: providers ?? _providers,
    stabilizer: stabilizer ?? _createStabilizer,
    rootInjector: rootInjector ?? _rootInjector,
    component: (component ?? _componentFactory) as ComponentFactory<E>?,
  );
}