Last active
September 30, 2015 01:19
-
-
Save Swoogan/98017f256edd37d49f42 to your computer and use it in GitHub Desktop.
Angular test example
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
angular.module('testModule', []).controller('TestCont', function ($scope) { | |
$scope.message = 'hello'; | |
} | |
describe('testModule module', function(){ | |
beforeEach(module('testModule')); | |
describe('test controller', function(){ | |
var scope, testCont; | |
beforeEach(inject(function($rootScope, $controller) { | |
scope = $rootScope.$new(); | |
testCont = $controller('TestCont', {$scope: scope}); | |
}); | |
it('message should be hello', function(){ | |
expect(scope.message).toEqual('hello'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment