How to test angular decorator functionality
问题 I have a decorator in Angular that is going to extend the functionality of the $log service and I would like to test it, but I don't see a way to do this. Here is a stub of my decorator: angular.module('myApp') .config(function ($provide) { $provide.decorator('$log', ['$delegate', function($delegate) { var _debug = $delegate.debug; $delegate.debug = function() { var args = [].slice.call(arguments); // Do some custom stuff window.console.info('inside delegated method!'); _debug.apply(null,