本文整理汇总了TypeScript中@angular/compiler/testing.ComponentFixture.detectChanges方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ComponentFixture.detectChanges方法的具体用法?TypeScript ComponentFixture.detectChanges怎么用?TypeScript ComponentFixture.detectChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/compiler/testing.ComponentFixture
的用法示例。
在下文中一共展示了ComponentFixture.detectChanges方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: callback
(componentFixture: ComponentFixture<TaskItem>) => {
const instance = componentFixture.debugElement.componentInstance;
instance.task = mockTask;
componentFixture.detectChanges();
callback(componentFixture);
}
示例2: expect
expect(() => {
fixture.detectChanges();
}).toThrowError(/tile with colspan 5 is wider than grid/);
示例3: expect
.then((fixture: ComponentFixture<TestComponent>) => {
fixture.detectChanges();
expect(highlightHtml(fixture)).toBe('123');
});
示例4: expect
.then((fixture: ComponentFixture<TestCmp>) => {
fixture.detectChanges();
expect(getListItems(fixture).length).toBe(10);
});
示例5: expect
.then((_) => {
rootTC.detectChanges();
expect(rootTC.debugElement.nativeElement).toHaveText('hello');
expect(location.urlChanges).toEqual(['/redirected']);
async.done();
});
示例6: expect
.then((_) => {
fixture.detectChanges();
expect(cmpInstanceCount).toBe(1);
expect(childCmpInstanceCount).toBe(1);
expect(fixture.debugElement.nativeElement).toHaveText('team angular { hello rado }');
})