Jasmine tests AngularJS Directives with templateUrl

前端 未结 8 611
执笔经年
执笔经年 2020-12-07 12:54

I\'m writing directive tests for AngularJS with Jasmine, and using templateUrl with them: https://gist.github.com/tanepiper/62bd10125e8408def5cc

However, when I run

8条回答
  •  有刺的猬
    2020-12-07 13:25

    As requested, converting a comment to an answer.


    For the people who want to make use of @Lior's answer in Yeoman apps:

    Sometimes the way the templates are referenced in karma config and consequently - the names of modules produced by ng-html2js don't match the values specified as templateUrls in directive definitions.
    You will need adjusting generated module names to match templateUrls.
    These might be helpful:

    • https://github.com/karma-runner/karma-ng-html2js-preprocessor#configuration
    • gist: https://gist.github.com/vucalur/7238489

提交回复
热议问题