这是我第一次使用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中)。我也找不到一般的业力日志 - 有一个吗?
答案 0 :(得分:5)
您需要将此行添加到karma.conf.js
exclude: ['app/lib/angular/angular-scenario.js'],
这里有一个与此问题有关的问题:https://github.com/angular/angular-phonecat/issues/71
答案 1 :(得分: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
不确定这是否是您想要的响应或者是否应该响应,但我认为我可能会分享它。