#Any way to test private logger?
8 messages · Page 1 of 1 (latest)
Technically, yes, but it's not pretty because private entities usually aren't tested
So would the best practice be to inject a logger service?
Personally, I think so. I dislike using new unless I'm creating a provider with it. If I'm in another provider I like to avoid the new keyword when possible
got it, thank you.
Wouldn't useLogger with a mock logger on the testing module work? The private logger will call the mocked logger underneath, on which you can intercept the calls
I believe that would work if you really wanted to test the private logger.