0
下面是代碼樣本:如何在角度測試http錯誤處理程序?
this.paymentTypesService.updatePaymentTypesOrder('cashout', newOrder).subscribe(() => {
this.notificationsService.success(
'Success!',
`Order change saved successfully`,
{ showProgressBar: true, pauseOnHover: true, clickToClose: true }
);
},() => {
this.notificationsService.error(
'Error',
`Order change save failed`,
{ showProgressBar: true, pauseOnHover: true, clickToClose: true }
);
});
還有就是paymentTypesService
方法背後簡單的HTTP服務......我應該怎樣測試在這種情況下,錯誤處理程序?
任何運氣這麼遠? –