You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
The $LogProvider mock service provider in angular-mock.js is missing the debugEnabled method. If an app module calls this method during configuration, no test will pass.
There is no workaround other than to guard against it by modifying your app.config call, e.g.
if ($logProvider.debugEnabled) {
$logProvider.debugEnabled(true)
}
You can't get clever in your test. This won't work:
beforeEach(module('app', function ($logProvider) {
// angular-mocks' $logProvider fake lacks debugEnabled; 'fix' that
if (!$logProvider.debugEnabled) {
$logProvider.debugEnabled = angular.noop;
}
}));
It doesn't work because the 'app' module would already have thrown an "undefined" exception before your test could monkey patch the debugEnabled method in this beforeEach.
The solution is pretty simple ... so I won't bother with a PR :-) . Just add the debugEnabled method to the mock $LogProvider in angular-mocks.js
The text was updated successfully, but these errors were encountered:
The
$LogProvider
mock service provider in angular-mock.js is missing thedebugEnabled
method. If an app module calls this method during configuration, no test will pass.There is no workaround other than to guard against it by modifying your app.config call, e.g.
You can't get clever in your test. This won't work:
It doesn't work because the 'app' module would already have thrown an "undefined" exception before your test could monkey patch the
debugEnabled
method in thisbeforeEach
.The solution is pretty simple ... so I won't bother with a PR :-) . Just add the
debugEnabled
method to the mock$LogProvider
in angular-mocks.jsThe text was updated successfully, but these errors were encountered: