Last active
February 6, 2017 17:13
-
-
Save javaeeeee/403566e62e28a0caced3a6034963e0b2 to your computer and use it in GitHub Desktop.
A test for an AngularJS controller that uses Controller As syntax relying on this syntax
This file contains hidden or 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('HelloController scope tests', function () { | |
var scope; | |
beforeEach(function () { | |
module('app'); | |
inject(function ($rootScope, $controller) { | |
scope = $rootScope.$new(); | |
$controller('HelloController as vm', { $scope: scope }); | |
}); | |
}); | |
it('should be World', function () { | |
expect(scope.vm.myModel).toEqual('World'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment