Skip to main content
Version: 15.0

@ngworker/spectacular

Enumerations

Classes

Interfaces

Type Aliases

CreateApplicationHarnessOptions

Ƭ CreateApplicationHarnessOptions: Pick<NgModule, "imports" | "providers">

Application harness options.

Defined in

packages/spectacular/src/lib/application-testing/application-harness/create-application-harness.ts:15


InitialFeatureNavigationFeature

Ƭ InitialFeatureNavigationFeature: SpectacularFeatureTestingFeature<InitialFeatureNavigationFeature>

A type alias that represents a feature which enables initial navigation to the specified feature path.

The type is used to describe the return value of the withInitialFeatureNavigation function.

See

Defined in

packages/spectacular/src/lib/feature-testing/configuration/with-initial-feature-navigation.ts:19


SpectacularFeatureTestingFeatures

Ƭ SpectacularFeatureTestingFeatures: InitialFeatureNavigationFeature

A type alias that represents all tree-shakable Spectacular Feature Testing features available for use with provideSpectacularFeatureTesting. Features can be enabled by adding special functions to the provideSpectacularFeatureTesting call.

See documentation for each symbol to find its corresponding function name. See also provideSpectacularFeatureTesting documentation on how to use those functions.

See

provideSpectacularFeatureTesting

Defined in

packages/spectacular/src/lib/feature-testing/configuration/spectacular-feature-testing-features.ts:55

Variables

spectacularAppTag

Const spectacularAppTag: "spectacular-app"

The tag name of SpectacularAppComponent's DOM element.

Defined in

packages/spectacular/src/lib/shared/app-component/spectacular-app.component.ts:7

Functions

createApplicationHarness

createApplicationHarness(options?): Promise<SpectacularApplicationHarness>

Bootstrap a test application with the specified metadata. Useful to test configuration Angular modules, bootstrap listeners, and application initializers.

Parameters

NameType
optionsCreateApplicationHarnessOptions

Returns

Promise<SpectacularApplicationHarness>

Defined in

packages/spectacular/src/lib/application-testing/application-harness/create-application-harness.ts:25


createFeatureHarness

createFeatureHarness(options): SpectacularFeatureHarness

Configure feature testing environment, bootstrap SpectacularAppComponent, and navigate to the default feature route.

Parameters

NameType
optionsCreateFeatureHarnessOptions

Returns

SpectacularFeatureHarness

Defined in

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


createPipeHarness

createPipeHarness<TValue>(options): SpectacularPipeHarness<TValue>

Set up a host component for the Angular pipe under test.

Test it by updating the value and reading the rendered text.

Type parameters

Name
TValue

Parameters

NameType
optionsCreatePipeHarnessOptions<TValue>

Returns

SpectacularPipeHarness<TValue>

Defined in

packages/spectacular/src/lib/pipe-testing/pipe-harness/create-pipe-harness.ts:57


provideSpectacularFeatureTest

provideSpectacularFeatureTest(options, ...features): (EnvironmentProviders | Provider)[]

Provide dependencies needed by the Spectacular Feature testing API.

Deprecated

Deprecated in favor of provideSpectacularFeatureTesting. To be removed in Spectacular 16.0.

Parameters

NameType
optionsProvideSpectacularFeatureTestOptions
...features(InitialFeatureNavigationFeature | RouterFeatures)[]

Returns

(EnvironmentProviders | Provider)[]

Defined in

packages/spectacular/src/lib/feature-testing/configuration/provide-spectacular-feature-test.ts:25


provideSpectacularFeatureTesting

provideSpectacularFeatureTesting(options, ...features): (EnvironmentProviders | Provider)[]

Provide dependencies needed by the Spectacular Feature testing API.

Parameters

NameType
optionsProvideSpectacularFeatureTestingOptions
...features(InitialFeatureNavigationFeature | RouterFeatures)[]

Returns

(EnvironmentProviders | Provider)[]

Defined in

packages/spectacular/src/lib/feature-testing/configuration/provide-spectacular-feature-testing.ts:36


withInitialFeatureNavigation

withInitialFeatureNavigation(): InitialFeatureNavigationFeature

Navigate to the specified feature path when the test is initialized.

Example

providers: [
provideSpectacularFeatureTesting(
{
featurePath: 'heroes',
routes: [
{ path: 'heroes', loadChildren: () => heroesRoutes },
],
},
withInitialFeatureNavigation(),
),
],

Returns

InitialFeatureNavigationFeature

Defined in

packages/spectacular/src/lib/feature-testing/configuration/with-initial-feature-navigation.ts:40