本文整理汇总了TypeScript中models/shared/data_sharing/data_reporting.DataReporting类的典型用法代码示例。如果您正苦于以下问题:TypeScript DataReporting类的具体用法?TypeScript DataReporting怎么用?TypeScript DataReporting使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DataReporting类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should deserialize data reporting from JSON', () => {
const reportingInfo = DataReporting.fromJSON(dataReportingJSON);
expect(reportingInfo.serverId()).toBe(dataReportingJSON._embedded.server_id);
expect(reportingInfo.lastReportedAt()).toEqual(new Date(dataReportingJSON._embedded.last_reported_at));
expect(reportingInfo.dataSharingServerUrl()).toBe(dataReportingJSON._embedded.data_sharing_server_url);
expect(reportingInfo.dataSharingGetEncryptionKeysUrl()).toBe(dataReportingJSON._embedded.data_sharing_get_encryption_keys_url);
expect(reportingInfo.canReport()).toBe(dataReportingJSON._embedded.can_report);
});
示例2: expect
jasmine.Ajax.withMock(() => {
jasmine.Ajax.stubRequest(DataReportingCompleteReportingURL, undefined, 'POST').andReturn({
status: 204,
responseHeaders: {
'Content-Type': 'application/vnd.go.cd.v2+json'
}
});
const successCallback = jasmine.createSpy();
DataReporting.completeReporting().then(successCallback);
expect(successCallback).toHaveBeenCalled();
});