我正在尝试对$ scope。$ evalAsync函数进行单元测试。这是我的代码:
$scope.$evalAsync(function(done) {
//enable the popover plugin
done();
jQuery('[data-toggle="popover"]').popover();
$scope.isKioskIdLoaded.state = true;
});
我很难理解如何在我的Jasmine测试中运行evalAsync。我正在尝试使用Jasmine 2.0中的done()函数。
答案 0 :(得分:0)
您需要在Jasmine测试中添加$scope.$digest()
。将evalasync函数添加到Angular的asyncQueue后,需要触发摘要。