I have inherited two angular apps. The one app(AppB) that I'm writing tests for and for lack of better phrasing it sets atop another app(AppB) that I've created. I want each of these to be their own separate repos with tests that cover that repo.
So I have a module with a controller that I want to test that looks something like this
angular.module('moduleName', ['moduleDependency1','moduleDependency2','moduleDependency3'])
Where moduleDependency2 is not included in the config because this particular code doesn't need to be tested in this module.
I have tried setting the following up to test this module
beforeEach(function() {
module('moduleName');
inject(function (_$rootScope_, _$controller_, _$q_) {
$rootScope = _$rootScope_;
$scope = $rootScope.$new();
$controller = _$controller_;
$q = _$q_;
});
});
however this returns:
Error: [$injector:modulerr] http://errors.angularjs.org/1.5.7/$injector/modulerr?p0=moduleName
I tried declaring each module dependency but the moduleDependency2 then threw an error about not being defined.
What am I missing here?