As I mentioned in the comment, I got around this problem by putting my intialisation code in an init
function. I then used ng-init
to start this code when it is on the dom. This allowed me to test the controller in code without it starting itself.
JS:
$scope.init = function() {
doSomething();
};
HTML:
<div ng-controller="myController" ng-init="init()">