describe('Controller: MainCtrl',function(){beforeEach(module('angularGruntExampleApp'));varMainCtrl,scope;beforeEach(inject(function($controller,$rootScope){scope=$rootScope.$new();MainCtrl=$controller('MainCtrl',{$scope:scope});}));it('should attach a list of awesomeThings to the scope',function(){expect(scope.awesomeThings.length).toBe(3);});});
// Defined out reference variable outsidevarmyService;// Wrap the parameter in underscoresbeforeEach(inject(function(_myService_){myService=_myService_;}));// Use myService in a series of tests.it('makes use of myService',function(){myService.doStuff();});