Skip to main content
Version: 14.1

Interface: SpectacularFeatureHarness

A harness for testing an Angular feature module.

Properties

location

Readonly location: SpectacularFeatureLocation

A subset of Angular's Location service adjusted to the Angular feature module under test.

Defined in

packages/spectacular/src/lib/feature-testing/feature-harness/spectacular-feature-harness.ts:41


rootComponent

Readonly rootComponent: SpectacularAppComponent

The bootstrapped component.

Defined in

packages/spectacular/src/lib/feature-testing/feature-harness/spectacular-feature-harness.ts:45


rootFixture

Readonly rootFixture: ComponentFixture<SpectacularAppComponent>

The component fixture for the bootstrapped component.

Defined in

packages/spectacular/src/lib/feature-testing/feature-harness/spectacular-feature-harness.ts:49


router

Readonly router: SpectacularFeatureRouter

A subset of Angular's Router API adjusted to the Angular feature module under test.

Defined in

packages/spectacular/src/lib/feature-testing/feature-harness/spectacular-feature-harness.ts:54

Methods

inject

inject<T>(token, notFoundValue?, flags?): T

Resolve a dependency based on the specified dependency injection token.

Type parameters

Name
T

Parameters

NameTypeDescription
tokenType<T> | InjectionToken<T> | AbstractType<T>The token representing the dependency, that is a class or an InjectionToken.
notFoundValue?TThe default value in case the specified dependency has not been provided. Optional. Default is null.
flags?InjectFlagsDependency injection options, for example InjectFlags.Optional \| InjectFlags.SkipSelf. Optional. Default is InjectFlags.Default.

Returns

T

Defined in

packages/spectacular/src/lib/feature-testing/feature-harness/spectacular-feature-harness.ts:27

inject<T>(token, notFoundValue, flags?): null | T

Type parameters

Name
T

Parameters

NameType
tokenType<T> | InjectionToken<T> | AbstractType<T>
notFoundValuenull
flags?InjectFlags

Returns

null | T

Defined in

packages/spectacular/src/lib/feature-testing/feature-harness/spectacular-feature-harness.ts:32