我已经安装了业力,现在呢? [英] I've installed Karma, now what?

查看:72
本文介绍了我已经安装了业力,现在呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的项目中安装并实现了Karma,但是我不确定从这里开始.

I've installed and implemented Karma in my project, but I'm not sure where to go from here.

我有一个非常简单的茉莉花规格,只是为了测试Karma:

I have one a very simple jasmine spec just to test Karma:

describe 'A suite', ->
  it 'contains spec with an expectation', ->
    expect(true).toBe true

但是,我从这里去哪里?

However, where do I go from here?

这是我在浏览器中访问它时的外观:

Here's how it looks when I visit it in a browser:

我的茉莉花规格在哪里?

这是我的控制台的外观:

Here's how my console looks:

rake karma:start
INFO [karma]: Karma v0.12.28 server started at http://localhost:9876/_karma_/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket FNsNSoQPPqyGCqhqIduv with id 80517079
PhantomJS 1.9.8 (Linux) LOG: 'WARNING: Tried to load angular more than once.'

PhantomJS 1.9.8 (Linux) ERROR
  TypeError: 'undefined' is not a function (evaluating 'window.angular.$$csp()')
  at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070


INFO [Chrome 39.0.2171 (Linux)]: Connected on socket HbXSzzvaLb-tMVMNIduw with id manual-2655
PhantomJS 1.9.8 (Linux) LOG: 'WARNING: Tried to load angular more than once.'

PhantomJS 1.9.8 (Linux) ERROR
  TypeError: 'undefined' is not a function (evaluating 'window.angular.$$csp()')
  at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070


Chrome 39.0.2171 (Linux) LOG: 'WARNING: Tried to load angular more than once.'

Chrome 39.0.2171 (Linux) ERROR
  Uncaught TypeError: undefined is not a function
  at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070

同样,不是我的提示

这些错误消息是否引起了问题?

Are these error messages causing a problem?

 Chrome 39.0.2171 (Linux) LOG: 'WARNING: Tried to load angular more than once.'

 Chrome 39.0.2171 (Linux) ERROR
      Uncaught TypeError: undefined is not a function
      at /var/lib/gems/1.9.1/gems/rails-assets-angular-1.3.8/app/assets/javascripts/angular/angular.js:26070

很抱歉,如果不清楚,但是我不知道会发生什么.我希望在访问localhost:9876/_karma_/时可以看到所有的茉莉花规格.我期望PhantomJS在控制台中有类似的输出,但是什么也没发生!我没什么可继续的.

Sorry if this is vague, but I have no idea what should happen. I'm expecting when I visit localhost:9876/_karma_/ for all my jasmine spec(s) to show. I'm expecting similiar output in the console from PhantomJS but nothing is happening! I've got nothing to go on.

任何帮助非常感谢(肯定是赏金的奖励)我如何展示我的规范!

Any help greatly appreciated (Definitely be awarding a bounty) on how I display my spec(s)!

推荐答案

两次加载角度绝对是这里的问题.如果您在业力配置文件的files元素中使用了... **/angular.js,我敢打赌您的项目中有多个angular.js文件,对我来说就是这样.您可以检查业力页并找到源以查看加载了哪些文件.祝你好运!

Loading angular twice is definitely the issue here. If you have used ...**/angular.js in the files element of the karma config file, I bet there are multiple angular.js files in your project, was the case for me.... You can inspect the karma page and find the sources to see what files were loaded. Good luck!

这篇关于我已经安装了业力,现在呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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