Fixture for debugging and testing a component.
构造函数
属性
属性名 | 类型 | 说明 |
---|
debugElement | | The DebugElement associated with the root element of this component. |
componentInstance | | The instance of the root component class. |
nativeElement | | The native element at the root of the component. |
elementRef | | The ElementRef for the element at the root of the component. |
changeDetectorRef | | The ChangeDetectorRef for the component |
componentRef | | 声明于构造函数中 |
ngZone | | 声明于构造函数中 |
方法
|
---|
Trigger a change detection cycle for the component. |
detectChanges(checkNoChanges: boolean = true): void参数checkNoChanges | Type: boolean . 可选. 默认值是 true . |
返回值void
|
|
---|
Do a change detection run to make sure there were no changes. |
checkNoChanges(): void参数没有参数。 返回值void
|
|
---|
Set whether the fixture should autodetect changes. |
autoDetectChanges(autoDetect: boolean = true)参数autoDetect | Type: boolean . 可选. 默认值是 true . |
|
Also runs detectChanges once so that any existing change is detected. |
|
---|
Return whether the fixture is currently stable or has async tasks that have not been completed yet. |
isStable(): boolean参数没有参数。 返回值boolean
|
|
---|
Get a promise that resolves when the fixture is stable. |
whenStable(): Promise<any>参数没有参数。 返回值Promise<any>
|
This can be used to resume testing after events have triggered asynchronous activity or asynchronous change detection. |
|
---|
Get a promise that resolves when the ui state is stable following animations. |
whenRenderingDone(): Promise<any>参数没有参数。 返回值Promise<any>
|
|
---|
Trigger component destruction. |
destroy(): void参数没有参数。 返回值void
|