EDIT : Quick & Dirty solution at the end of this post
I am using a modal window from AngularUI-Bootstrap in the same way that it is explained on
+1 for fiznool's answer. it is correct and should be chosen..
I would like to note one thing though, it is not maintainable the way it is presented here.
Since this is angular, I suggest use it..
angular.module('...').service('$modalInstance', function(){
... define spies and such
})
would make your code much more modular and generic.
simply add a file under spec somewhere with the above content and make sure to include it in your karma.conf
if you want to make sure it loads only in specific tests, simply give it a unique module name and add it to module invocation in beforeEach