Created
September 5, 2014 15:04
-
-
Save jackinf/7b3df45e1eb030f9584a to your computer and use it in GitHub Desktop.
[JASMINE, ANGULAR] My Angular spec template
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("jsTests:", function () { | |
var $scope, $controller, $httpBackend, $injector; | |
var myService; | |
beforeEach(function () { | |
module("kn"); | |
}); | |
beforeEach(function () { | |
this.addMatchers({ | |
toEqualData: function (expect) { | |
return angular.equals(expect, this.actual); | |
} | |
}); | |
}); | |
// ReSharper disable InconsistentNaming | |
beforeEach(inject(function ($rootScope, _$controller_, _$httpBackend_, _$injector_) { | |
// ReSharper restore InconsistentNaming | |
$scope = $rootScope.$new(); | |
$controller = _$controller_; | |
$httpBackend = _$httpBackend_; | |
$injector = _$injector_; | |
myService = $injector.get("MyService"); | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment