3

这是我第一次使用 Angular(和 Karma),所以如果这是一个初学者的问题,请原谅:我就是这样。

我正在尝试运行 Angular-phonecat 测试,如步骤 02 - 编写和运行测试中所述

我的代码直接从第 2 步分支 ( git checkout -f step-2)签出

运行测试 ( angular-phonecat\scripts> test) 时,我收到以下消息:

INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599 (Windows 7)]: Connected on socket Jw-2z-zZ-pytGNN-SHRM
Chrome 30.0.1599 (Windows 7): Executed 0 of 0 ERROR (0.472 secs / 0 secs)

没有提供更多信息,我找不到任何详细说明问题的日志(/test 或其子目录中没有任何内容,/logs 中也没有)。我也找不到一般的业力日志 - 有吗?

4

2 回答 2

5

您需要将此行添加到 karma.conf.js

exclude: ['app/lib/angular/angular-scenario.js'],

这里有一个与此问题相关的问题:https ://github.com/angular/angular-phonecat/issues/71

于 2013-10-10T21:38:41.923 回答
1

嗨,我今天从角度和业力开始,我在 Mac 上,我也有同样的问题。我在 freenode 加入了 IRC 频道 #angularjs 并寻求帮助,这就是我得到的答案。

[16:59] <Wirde> Hi, I just started with the Angular-phonecat tutorial, after installing karma and the adapters I got too step 2 but when I try to run the unit tests it gives me the error: Executed 0 of 0 ERROR (0.327 secs / 0 secs). Can some please tell me whats wrong?
[17:00] <dmco> Wirde: I think phonecat is wonky after some 1.2rcX upgrades
[17:01] <dmco> Wirde: Another guy was complaining about issues with it yesterday
[17:02] <Wirde> dmco: hi, thanks for the answer, how do you suggest i proceed? Is there another good way to learn about karma and testing with angular?
[17:02] <rdepena> http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html#karma
[17:02] <dmco> Wirde: One easy way would be to scaffold a new project using Yeoman and the AngularJS generator
[17:02] <rdepena> this is a great source
[17:02] <dmco> ^^ Wirde that is a good link too
[17:03] <Wirde> dmco: rdepena: Thank you for the help! I will check it out :D

不确定这是否是您想要的响应,或者是否足够,但我认为我可能会分享它。

于 2013-10-10T15:08:03.700 回答