本文整理汇总了TypeScript中angular2/test_lib.Log类的典型用法代码示例。如果您正苦于以下问题:TypeScript Log类的具体用法?TypeScript Log怎么用?TypeScript Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Log类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should process micro-tasks created in timers before next timers', fakeAsync(() => {
var log = new Log();
PromiseWrapper.resolve(null).then((_) => log.add('microtask'));
TimerWrapper.setTimeout(() => {
log.add('timer');
PromiseWrapper.resolve(null).then((_) => log.add('t microtask'));
}, 9);
var id = TimerWrapper.setInterval(() => {
log.add('periodic timer');
PromiseWrapper.resolve(null).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');
TimerWrapper.clearInterval(id);
}));
示例2: beforeEach
beforeEach(() => {
log = new Log();
zone = new VmTurnZone({enableLongStackTrace: true});
zone.initCallbacks({
onTurnStart: log.fn('onTurnStart'),
onTurnDone: log.fn('onTurnDone')
});
});
示例3:
PromiseWrapper.resolve(null).then((_) => log.add(2));