本文整理汇总了TypeScript中core/orchestratedItem/orchestratedItem.transformer.OrchestratedItemTransformer类的典型用法代码示例。如果您正苦于以下问题:TypeScript transformer.OrchestratedItemTransformer类的具体用法?TypeScript transformer.OrchestratedItemTransformer怎么用?TypeScript transformer.OrchestratedItemTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了transformer.OrchestratedItemTransformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it('waits for task to complete, then calls onComplete', () => {
let completeCalled = false;
const task: any = { id: 'a', status: 'RUNNING' };
OrchestratedItemTransformer.defineProperties(task);
const operation = () => $q.when(task);
const monitor = new TaskMonitor({
application: applicationModelBuilder.createApplication('app', { key: 'runningTasks', lazy: true }),
title: 'some task',
modalInstance: { result: $q.defer().promise } as IModalServiceInstance,
onTaskComplete: () => (completeCalled = true),
});
spyOn(monitor.application.getDataSource('runningTasks'), 'refresh');
monitor.submit(operation);
expect(monitor.submitting).toBe(true);
expect(monitor.error).toBe(false);
$timeout.flush(); // still running first time
$http.expectGET([API.baseUrl, 'tasks', 'a'].join('/')).respond(200, { status: 'RUNNING' });
$timeout.flush();
$http.flush();
expect(monitor.task.isCompleted).toBe(false);
expect((monitor.application.getDataSource('runningTasks').refresh as Spy).calls.count()).toBe(1);
$http.expectGET([API.baseUrl, 'tasks', 'a'].join('/')).respond(200, { status: 'SUCCEEDED' });
$timeout.flush(); // complete second time
$http.flush();
expect(completeCalled).toBe(true);
expect(monitor.task.isCompleted).toBe(true);
});
开发者ID:mizzy,项目名称:deck,代码行数:34,代码来源:taskMonitor.spec.ts
示例2: transformBuild
private transformBuild(build: ICiBuild): ICiBuild {
build.startTime = build.startedAt;
build.endTime = build.completedAt;
build.isRunning = build.completionStatus === 'INCOMPLETE';
this.orchestratedItemTransformer.addRunningTime(build);
return build;
}
开发者ID:brujoand,项目名称:deck,代码行数:8,代码来源:ciBuild.read.service.ts
注:本文中的core/orchestratedItem/orchestratedItem.transformer.OrchestratedItemTransformer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论