本文整理汇总了TypeScript中@angular/core/testing/src/testing_internal.Log.result方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Log.result方法的具体用法?TypeScript Log.result怎么用?TypeScript Log.result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core/testing/src/testing_internal.Log
的用法示例。
在下文中一共展示了Log.result方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should process micro-tasks created in timers before next timers', fakeAsync(() => {
const log = new Log();
resolvedPromise.then((_) => log.add('microtask'));
setTimeout(() => {
log.add('timer');
resolvedPromise.then((_) => log.add('t microtask'));
}, 9);
const id = setInterval(() => {
log.add('periodic timer');
resolvedPromise.then((_) => log.add('pt microtask'));
}, 10);
tick(10);
expect(log.result())
.toEqual('microtask; timer; t microtask; periodic timer; pt microtask');
tick(10);
expect(log.result())
.toEqual(
'microtask; timer; t microtask; periodic timer; pt microtask; periodic timer; pt microtask');
clearInterval(id);
}));
示例2: expect
() => {
const fixture = TestBed.createComponent(MyComp5);
fixture.detectChanges();
expect(log.result())
.toEqual(
'ngOnChanges; ngOnInit; ngDoCheck; ngAfterContentInit; ngAfterContentChecked; child_ngDoCheck; ' +
'ngAfterViewInit; ngAfterViewChecked');
log.clear();
fixture.detectChanges();
expect(log.result())
.toEqual('ngDoCheck; ngAfterContentChecked; child_ngDoCheck; ngAfterViewChecked');
});
示例3: macroTask
macroTask(() => {
expect(_log.result())
.toEqual(
'onUnstable; zone run; onMicrotaskEmpty; onStable; ' +
'onUnstable; promise then; onMicrotaskEmpty; onStable');
async.done();
}, resultTimer);