-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
spectacular-application-harness.ts
43 lines (42 loc) · 1.34 KB
/
spectacular-application-harness.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type {
AbstractType,
InjectFlags,
InjectionToken,
Type,
} from '@angular/core';
import type { ComponentFixture } from '@angular/core/testing';
import type { SpectacularAppComponent } from '../../shared/app-component/spectacular-app.component';
/**
* A harness for testing application-level software artifacts.
*/
export interface SpectacularApplicationHarness {
/**
* Resolve a dependency based on the specified dependency injection token.
*
* @param token The token representing the dependency, that is a class or an
* `InjectionToken`.
* @param notFoundValue The default value in case the specified dependency
* has not been provided. Optional. Default is `null`.
* @param flags Dependency injection options, for example
* `InjectFlags.Optional | InjectFlags.SkipSelf`. Optional. Default is
* `InjectFlags.Default`.
*/
inject<T>(
token: Type<T> | InjectionToken<T> | AbstractType<T>,
notFoundValue?: T,
flags?: InjectFlags
): T;
inject<T>(
token: Type<T> | InjectionToken<T> | AbstractType<T>,
notFoundValue: null,
flags?: InjectFlags
): T | null;
/**
* The bootstrapped component.
*/
readonly rootComponent: SpectacularAppComponent;
/**
* The component fixture for the bootstrapped component.
*/
readonly rootFixture: ComponentFixture<SpectacularAppComponent>;
}