本文整理匯總了TypeScript中models/notifications/system_notifications.SystemNotifications.setNotifications方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript SystemNotifications.setNotifications方法的具體用法?TypeScript SystemNotifications.setNotifications怎麽用?TypeScript SystemNotifications.setNotifications使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models/notifications/system_notifications.SystemNotifications
的用法示例。
在下文中一共展示了SystemNotifications.setNotifications方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Date
jasmine.Ajax.withMock(() => {
const twentyNineMinutesBack = new Date(Date.now() - 29 * 60 * 1000);
localStorage.setItem("versionCheckInfo", JSON.stringify({last_updated_at: twentyNineMinutesBack}));
document.body.setAttribute("data-current-gocd-version", "19.3.0-1234");
localStorage.setItem(VersionUpdater.CURRENT_GOCD_VERSION_KEY, "19.3.0-1234");
const systemNotifications = new SystemNotifications();
systemNotifications.add(new Notification(updateNotificationJSON));
SystemNotifications.setNotifications(systemNotifications);
expect(JSON.parse(localStorage.getItem("system_notifications") as string)).toHaveLength(1);
VersionUpdater.update();
expect(JSON.parse(localStorage.getItem("system_notifications") as string)).toHaveLength(1);
});