本文整理匯總了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();
});