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

1.2.0rc1 angular.mock.$LogProvider debugEnabled isDefined error #3612

Closed
madaz opened this issue Aug 15, 2013 · 1 comment
Closed

1.2.0rc1 angular.mock.$LogProvider debugEnabled isDefined error #3612

madaz opened this issue Aug 15, 2013 · 1 comment
Milestone

Comments

@madaz
Copy link
Contributor

madaz commented Aug 15, 2013

The angular-mocks.js is missing the namespace angular for angular.mock.$LogProvider debugEnabled isDefined check.

This causes exceptions in jasmine/karma unit tests when you have the following in your main app.js

    app.config([
        '$logProvider',
        function ($logProvider) {
            $logProvider.debugEnabled(true);
        }
    ]);

angular-mocks.js 1.2.0rs1 has:

  this.debugEnabled = function(flag) {
      if (isDefined(flag)) {
          debug = flag;
          return this;
      } else {
          return debug;
      }
  };

Possibly should be:

  this.debugEnabled = function(flag) {
      if (angular.isDefined(flag)) {
          debug = flag;
          return this;
      } else {
          return debug;
      }
  };
@jbdeboer
Copy link
Contributor

We should fix this bug. It looks like you have a good handle on it; could you send a pull request?

@ghost ghost assigned vojtajina Aug 29, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Sep 25, 2013
angular.mocks.$LogProvider $logProvider.debugEnabled(false) is crashing
with undefined when run inside karma/jasmine test runner:

angular.module('foo', []).config(['$logProvider', function ($logProvider) {
  $logProvider.debugEnabled(false);
}]);

Closes angular#3612
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
angular.mocks.$LogProvider $logProvider.debugEnabled(false) is crashing
with undefined when run inside karma/jasmine test runner:

angular.module('foo', []).config(['$logProvider', function ($logProvider) {
  $logProvider.debugEnabled(false);
}]);

Closes angular#3612
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants