Keith - Any luck with this? I am running into an issue where I've also decorated $log and $exceptionHandler. Now the ngmock versions of $log and $exceptionHandler never get fired, but the tests use my overridden ones. I can't figure out how to circumvent this.
On Thursday, March 27, 2014 11:34:49 AM UTC-4, Keith Rogers wrote: > > 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.
