angularjs - Karma 抛出错误 : Can not load "ng-html2js", 它未注册

标签 angularjs karma-runner ng-html2js

运行 karma start 时遇到错误:

$ karma start
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
WARN [preprocess]: Can not load "ng-html2js", it is not registered!
  Perhaps you are missing some plugin?

...

但在我的包文件中,我有 "karma-ng-html2js-preprocessor": "*", 并且包含此预处理器代码的文件夹存在于 node_modules 中。

关于如何解决这个问题有什么想法吗?

最佳答案

就我而言,问题与 karma 配置 plugins 部分中缺少 karma-ng-html2js-preprocessor 有关。在教程中,我看到您不需要在插件内添加 'ng-html2js' ,但对我来说,没有它就无法工作。

关于angularjs - Karma 抛出错误 : Can not load "ng-html2js", 它未注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19069183/

相关文章:

javascript - Expect 方法读取了错误的wrapper.vm.shown 值

javascript - isolateScope() 给出未定义的 - 使用 Karma 的单元测试指令

regex - html2js stripPrefix 基于用户的正则表达式

AngularJS Karma 测试 : Unexpected request: GET. template.html

angular 7 + angular cli 7+ ng 测试不工作

javascript - AngularJS 上的工厂无法正常工作。错误 "Cannot read property ' getInfoApi' 未定义”

javascript - AngularJS $http get 请求未正确编码对象内的日期

javascript - AngularJS 无法向 SLIM 框架发送 POST 请求

javascript - 是否有义务运行 Node 服务器以执行基于 Angular 的应用程序

javascript - 无法设置未定义错误的属性 '$submitted' - Jasmine AngularJS