Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created February 6, 2017 17:17
Show Gist options
  • Save javaeeeee/c9733c1f4ba91d61cbf159741ad15bc9 to your computer and use it in GitHub Desktop.
Save javaeeeee/c9733c1f4ba91d61cbf159741ad15bc9 to your computer and use it in GitHub Desktop.
A test for an AngularJS controller that uses Controller As syntax. The test doesn't rely on AngularJS scope
describe('HelloController tests', function () {
var HelloController;
beforeEach(function () {
module('app');
inject(function ($controller) {
HelloController = $controller('HelloController');
});
});
it('should be World', function () {
expect(HelloController.myModel).toEqual('World');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment