I would like to Jasmine test that Welcome.go has been called. Welcome is an angular service.
angular.module(\'welcome\',[])
.run(function(Welcome) {
We
Managed to figure it out. Here is what I came up with:
'use strict';
describe('module: welcome', function () {
var Welcome;
beforeEach(function() {
module('welcome', function($provide) {
$provide.value('Welcome', {
go: jasmine.createSpy('go')
});
});
inject(function (_Welcome_) {
Welcome = _Welcome_;
})
});
it('should call Welcome.go on module run', function() {
expect(Welcome.go).toHaveBeenCalled();
});
});