Angularjs – 在官方教程中运行单元测试时出错
发布时间:2020-12-17 17:40:23 所属栏目:安全 来源:网络整理
导读:嗨我遵循角度的 this 教程,但通过运行以下命令test.bat.我得到这个错误,并不是很好. “无法加载脚本,它没有注册!也许你错过了一些插件” 我按照本教程的所有步骤操作,我想我错过了插件.我在应用程序的根目录中有一个名为node_modules的文件夹,其中包含所有
嗨我遵循角度的
this 教程,但通过运行以下命令test.bat.我得到这个错误,并不是很好.
“无法加载脚本,它没有注册!也许你错过了一些插件” 我按照本教程的所有步骤操作,我想我错过了插件.我在应用程序的根目录中有一个名为node_modules的文件夹,其中包含所有这些插件 karma karma-chrome-launcher karma-coffee-preprocessor karma-firefox-launcher karma-html2js-preprocessor karma-jasmine karma-junit-reporter karma-phantomjs-launcher karma-RequireJS karma-script-launcher 我的karma.config module.exports = function(config){ config.set({ basePath : '../',files : [ 'app/lib/angular/angular.js','app/lib/angular/angular-*.js','test/lib/angular/angular-mocks.js','app/js/**/*.js','test/unit/**/*.js' ],exclude: ['app/lib/angular/angular-scenario.js'],autoWatch : true,frameworks: ['jasmine'],browsers : ['C:/Program Files/Google/Chrome/Application/chrome.exe'],plugins : [ 'karma-junit-reporter','karma-chrome-launcher','karma-firefox-launcher','karma-jasmine' ],junitReporter : { outputFile: 'test_out/unit.xml',suite: 'unit' } })} 有人可以帮帮我吗? 谢谢 解决方法
您需要将缺少的插件添加到karma配置插件部分:
plugins : [ 'karma-junit-reporter', 或者只是删除这个插件部分,业力将加载它找到的所有插件. (如果没有太多的插件,可以这样做) 编辑: 刚刚克隆并安装了测试项目.以下是已安装的依赖项: karma karma-html2js-preprocessor karma-phantomjs-launcher karma-chrome-launcher karma-jasmine karma-requirejs karma-coffee-preprocessor karma-junit-reporter karma-script-launcher karma-firefox-launcher karma-ng-scenario phantomjs 在我看来,你没有安装phantomjs. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
热点阅读