0
是否有遠程任何方式來模擬量角器測試中的任何SSE(服務器發送事件)?量角器:嘲諷EventSource
這意味着嘲笑EventSource
角控制器:
angular.module('app').controller('HomeController', function() {
var monitoringEvents = new window.EventSource('/streams/jobserveur');
monitoringEvents.addEventListener('monitoring-event', function(e) {
var json = JSON.parse(e.data);
...
});
});
謝謝你的任何洞察
你能表現出一定的代碼,其中將需要的嘲諷? (或者你嘗試過的一些代碼並沒有工作?) – acdcjunior
我添加了引用EventSource的控制器代碼。 我對於如何嘲笑這件事情一無所知。也許我可以將'EventSource'封裝到Angular模塊中,並在測試中使用'AddMockModule' ... – nastyklad