Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was 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

Description

@madaz

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;
      }
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions