Created
January 26, 2014 22:20
-
-
Save rolaveric/8640211 to your computer and use it in GitHub Desktop.
AngularJS Unit Test: Controller, template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('MyCtrl', function () { | |
var ctrl, scope, service; | |
beforeEach(inject(function ($controller, $rootScope, myService) { | |
service = myService; | |
scope = $rootScope.$new(); | |
ctrl = $controller('MyCtrl', {"$scope": scope, "myService": service}); | |
})); | |
describe('doSomething()', function () { | |
it('Returns something', function () { | |
expect(scope.doSomething()).not.toBeUndefined(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment