johnpapa / generator-hottowel

Yo generator that creates an Angular app via HotTowel
835 stars 230 forks source link

Unit testing exception handler #157

Closed bampakoa closed 8 years ago

bampakoa commented 8 years ago

@johnpapa I noticed that the unit test of exception-handler.provider.js, does not check if the logger is called at all. Is there any specific reason for that?

Thanks

johnpapa commented 8 years ago

what do you mean "check"?

bampakoa commented 8 years ago

Shouldn't we test the call of logger function in the unit test? Something like:

expect(logger).toHaveBeenCalled()

johnpapa commented 8 years ago

ah, sure

im making a bunch of updates right now. but i'd love to see a PR for this

bampakoa commented 8 years ago

I tried to test it inside the catch block, after the last expect statement, but I seems that it never reaches logger.error statement during testing. Is it possible that $delegate(exception, cause) prevents it from that?

bampakoa commented 8 years ago

Closed in replace of PR #170.