AngularJS Karma-Jasmine进入$ q.when()。finally(function(){});在单元测试中

时间:2018-03-08 22:02:28

标签: angularjs karma-jasmine angular-promise

angular.module('some-module').service('some-service', [
'a_workflow',
'b_api',
function(Workflow, Api) {
    this.prepareToEnterFlow = function(forward, flowContext, pageContext, transitionData, callback) {
        flowContext.data = transitionData.data;
        $q.when(flowContext.data.container).finally(function() {
             var value = 'I am testing';
             console.log(value);
             $q.when(flowContext.data.container.cookies).finally(function() {

             });
        });
    }
}

]);

我如何在单元测试中看到“我正在测试”?我需要嘲笑到达那里吗?

0 个答案:

没有答案