lundi 25 avril 2016

Decorated $log fails in unit tests because of ngMock

In out project we have decorated $log service, that exposes a method .prefix(). We use it like $log.prefix('Some Prefix text here').

This works fine in every module we use $log in, but not the unit tests:

$log.prefix is not a function

It has to do that $log is changed by ngMock module. As we use $log.prefix in every of our modules, I don't want to rewrite every unit test of these modules.

Question: Is there a way to decorate the $log method of ngMock?

Aucun commentaire:

Enregistrer un commentaire