How to test directives that use templateUrl and controllers?
问题 EDIT: after asking the question, i'm now editing this to elaborate on my findings. My app is modularized using directives. I'm writing my directives such that they (1) create their own scope (2) use templateUrl, and (3) do most of the logic and server data fetching in their controller. The question is how to unit test it, using Mocha with Karma. 回答1: a test is written for each directive. Since the directive uses templateUrl, I used html2js. the html key should be included as a module - that