本文整理匯總了TypeScript中core/pipeline/config/services/PipelineConfigService.PipelineConfigService.savePipeline方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript PipelineConfigService.savePipeline方法的具體用法?TypeScript PipelineConfigService.savePipeline怎麽用?TypeScript PipelineConfigService.savePipeline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core/pipeline/config/services/PipelineConfigService.PipelineConfigService
的用法示例。
在下文中一共展示了PipelineConfigService.savePipeline方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('clears isNew flags, stage name if not present', () => {
const pipeline: IPipeline = buildPipeline({
stages: [
{ name: 'explicit name', type: 'bake', isNew: true },
{ name: null, type: 'bake', isNew: true },
{ name: '', type: 'bake', isNew: true },
],
});
$http
.expectPOST(API.baseUrl + '/pipelines', (requestString: string) => {
const request = JSON.parse(requestString) as IPipeline;
return (
request.stages[0].name === 'explicit name' &&
!request.stages[1].name &&
!request.stages[2].name &&
request.stages.every(s => !s.isNew)
);
})
.respond(200, '');
PipelineConfigService.savePipeline(pipeline);
$scope.$digest();
$http.flush();
$http.verifyNoOutstandingRequest();
});
示例2: it
it('clears isNew flags, stage name if not present', () => {
const pipeline: IPipeline = buildPipeline({
stages: [
{ name: 'explicit name', type: 'bake', isNew: true },
{ name: null, type: 'bake', isNew: true },
{ name: '', type: 'bake', isNew: true },
],
});
$http.expectPOST(API.baseUrl + '/pipelines').respond(200, '');
PipelineConfigService.savePipeline(pipeline);
$scope.$digest();
expect(pipeline.stages[0].name).toBe('explicit name');
expect(pipeline.stages[1].name).toBeUndefined();
expect(pipeline.stages[2].name).toBeUndefined();
expect(pipeline.stages[0].isNew).toBeUndefined();
expect(pipeline.stages[1].isNew).toBeUndefined();
expect(pipeline.stages[2].isNew).toBeUndefined();
});