I want to use jasmine's beforeAll instead of beforeEach but angular.mock.module and angular.mock.inject functions are not working in beforeAll whereas they're working in beforeEach.
Here is my test. the same code is working in beforeEach approach.
describe("This is a test", function () {
beforeAll(module("app"));
var vm;
beforeAll(function() {
angular.mock.module(function ($provide) {
$provide.factory("dataService", ["$q", function ($q) {
return {
getSomeDataById: function () { return $q.resolve({ }); }
};
}]);
});
angular.mock.inject(function (_$controller_,dataService) {
vm = _$controller_("TestController",
{
dataService: dataService
});
});
});
});