Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
refactor(ngMock): make ngMock minification-safe
Browse files Browse the repository at this point in the history
It is not common, but some workflows result in `angular-mocks` being minified.

Fixes #13542

Closes #14073
  • Loading branch information
gkalpak committed Feb 23, 2016
1 parent 2ffda41 commit 59aef48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ngMock/angular-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2659,11 +2659,11 @@ if (window.jasmine || window.mocha) {
var fn, modules = currentSpec.$modules || (currentSpec.$modules = []);
angular.forEach(moduleFns, function(module) {
if (angular.isObject(module) && !angular.isArray(module)) {
fn = function($provide) {
fn = ['$provide', function($provide) {
angular.forEach(module, function(value, key) {
$provide.value(key, value);
});
};
}];
} else {
fn = module;
}
Expand Down Expand Up @@ -2784,9 +2784,9 @@ if (window.jasmine || window.mocha) {
function workFn() {
var modules = currentSpec.$modules || [];
var strictDi = !!currentSpec.$injectorStrict;
modules.unshift(function($injector) {
modules.unshift(['$injector', function($injector) {
currentSpec.$providerInjector = $injector;
});
}]);
modules.unshift('ngMock');
modules.unshift('ng');
var injector = currentSpec.$injector;
Expand Down

0 comments on commit 59aef48

Please sign in to comment.