NgTestBed<T extends Object>.useInitReflector constructor

NgTestBed<T extends Object>.useInitReflector({
  1. Element? host,
  2. InjectorFactory? rootInjector,
  3. bool watchAngularLifecycle = true,
})

Create a new empty NgTestBed that creates a component type T.

May optionally specify what DOM element should host the component.

By default, the resulting NgTestFixture automatically waits for Angular to signal completion of change detection - this behavior can vbe disabled by setting watchAngularLifecycle to false.

WARNING: Path not recommended. See NgTestBed instead.

Implementation

factory NgTestBed.useInitReflector({
  Element? host,
  InjectorFactory? rootInjector,
  bool watchAngularLifecycle = true,
}) {
  if (T == dynamic) {
    throw GenericTypeMissingError();
  }
  return NgTestBed<T>._allowDynamicType(
    host: host,
    rootInjector: rootInjector,
    watchAngularLifecycle: watchAngularLifecycle,
  );
}