Added overload to angular.mock.inject function to allow array-style dependency injection, which the function supports. Added test excercising the overload.

This commit is contained in:
Jeremy Bell
2014-05-23 17:47:07 -04:00
parent 36febf66ea
commit 9e30ccf2e5
2 changed files with 10 additions and 0 deletions
+9
View File
@@ -21,6 +21,15 @@ mock.inject(
function () { return 2; }
);
mock.inject(
['$rootScope', function ($rootScope) { return 1; }]);
// This overload is not documented on the website, but flows from
// how the injector works.
mock.inject(
['$rootScope', function ($rootScope) { return 1; }],
['$rootScope', function ($rootScope) { return 2; }]);
mock.module('module1', 'module2');
mock.module(
function () { return 1; },