I've got a log decorator in my application so that we can pass log messages 
on to a service that periodically sends the logs to the server. However, 
when we are unit testing this service is still trying to send logs off as 
the mock log is still being decorated.

Ideally we'd disable this functionality when testing - we tried looking at 
the delegate in the decorator and detecting if it is the ngmock log (by 
looking for the reset function) and not modifying the log if this is the 
case. However this means that we cannot test the decorator itself, as it 
will always turn itself off when we are trying to test it...

Our options seem to be

   - Stub $log in all unit tests (except those specifically testing the 
   decorator) 
   - Not test the decorator at all
   - ???

Is there any way we can specify whether we want the actual log or the 
ngmock log in dependency injection? If we could do this, then we could 
ensure that we are testing with the actual log in the decorator tests, 
while letting all the others use the mock log.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to