茉莉:如何看到在浏览器中的报告? [英] Jasmine: How to see the reports in the browser?

查看:283
本文介绍了茉莉:如何看到在浏览器中的报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

局势:

我目前正在运行的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 your karma.conf.js

  • In the chrome page hit the DEBUG button. You should be taken to a new page that has the report.

这篇关于茉莉:如何看到在浏览器中的报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆