After creating a controller in my test, I encountered an issue with the updateActionList function...
this.createScope = function(scope) {
if (scope) {
this.scope = scope;
} else {
this.scope = $rootScope.$new();
}
this.controller = $controller("menuController", {
"$scope": this.scope,
updateActionList: function() {
return {
finally: function() {}
};
}
});
};
I made some modifications by adding this part...
updateActionList: function() {
return {
finally: function() {}
};
}
This led to failures in all of my tests due to...
TypeError: undefined is not an object (evaluating 'updateActionList().finally')
The problematic code involves the local function updateActionList(), which is called like so in the actual code...
updateActionList().finally(function() {
//Do stuff
});
updateActionList() returns a promise from getThings() with both .then and .finally blocks.
My goal is for the finally block to automatically resolve itself so that the tests can pass smoothly.
If anyone has any insights on why finally is coming up as undefined, please let me know. Thank you!