茉莉:如何看到在浏览器中的报告? [英] Jasmine: How to see the reports in the browser?
问题描述
局势:
我目前正在运行的AngularJs单元测试在控制台中。
我打开控制台的文件夹,我运行人缘启动
并检查控制台的测试结果。
我想看看在浏览器中的结果,但我无法看到它们为止。所有我可以看到是这样的:
问题:
我怎么能看到在浏览器中测试的报告?
正确的插件应该是卡玛 - 茉莉HTML的记者吧?
的配置:
karma.conf.js:
框架:['茉莉花'],文件:
bower_components /角/ angular.js',
bower_components /角嘲笑/角mocks.js',
./test/**/*.js',
app.js
]插件:
因果报应 - 铬 - 发射',
卡玛 - 火狐-发射',
卡玛 - phantomjs-发射',
卡玛 - 茉莉花,
卡玛 - 茉莉HTML的记者]浏览器:['PhantomJS','铬'],
假设你有茉莉花2.0,
-
中添加
记者:HTML]
你的karma.conf.js
-
在Chrome浏览器网页按
DEBUG
按钮。你应该采取具有报告了新的一页。
THE SITUATION:
I am currently running AngularJs unit tests in the console.
I open the folder in the console and i run karma start
and check the result of the tests in the console.
I would like to see the results in the browser but I cannot see them so far. All i can see is this:
THE QUESTION:
How can i see the reports of the tests in the browser? The proper plugin should be karma-jasmine-html-reporter right?
THE CONFIGURATION:
karma.conf.js:
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'./test/**/*.js',
'app.js'
],
plugins : [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-jasmine-html-reporter'
],
browsers: ['PhantomJS', 'Chrome'],
Assuming you have jasmine 2.0,
add in
reporters: ['html'],
to yourkarma.conf.js
In the chrome page hit the
DEBUG
button. You should be taken to a new page that has the report.
这篇关于茉莉:如何看到在浏览器中的报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!