17
jasmine:异步回调未在jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时内调用
我有一个叫的服务requestNotificationChannel: app.factory("requestNotificationChannel", function($rootScope) { var _DELETE_MESSAGE_ = "_DELETE_MESSAGE_"; function deleteMessage(id, index) { $rootScope.$broadcast(_DELETE_MESSAGE_, { id: id, index: index }); }; return { deleteMessage: deleteMessage }; }); 我正在尝试使用茉莉花对该服务进行单元测试: "use strict"; describe("Request Notification Channel", function() { var requestNotificationChannel, rootScope, scope; beforeEach(function(_requestNotificationChannel_) { module("messageAppModule"); inject(function($injector, _requestNotificationChannel_) { rootScope = $injector.get("$rootScope"); scope = rootScope.$new(); …