create method

Future<NgTestFixture<T>> create({
  1. FutureOr<void> beforeComponentCreated(
    1. Injector
    )?,
  2. FutureOr<void> beforeChangeDetection(
    1. T instance
    )?,
})

Creates a new test application with T as the root component.

If beforeChangeDetection is set, it is called before any initial change detection (so you can do initialization of component state that might be required).

Returns a future that completes with a fixture around the component.

Implementation

Future<NgTestFixture<T>> create({
  FutureOr<void> Function(Injector)? beforeComponentCreated,
  FutureOr<void> Function(T instance)? beforeChangeDetection,
}) {
  return _createDynamic(
    T,
    beforeComponentCreated: beforeComponentCreated,
    beforeChangeDetection: beforeChangeDetection,
  );
}