当一次测试失败时,Karma测试运行器会阻止输出

时间:2013-10-16 11:16:05

标签: angularjs karma-runner

我正在使用karma测试运行器测试AngularJs控制器等(Windows 7,phantomJs)

在我的机器上运行测试时,我会在输出中为每个已运行的测试获得一行。 e.g:

PhantomJS 1.9.1 (Windows 7): Executed 156 of 201 (1 FAILED) (0 secs / 0.423 secs
PhantomJS 1.9.1 (Windows 7): Executed 157 of 201 (1 FAILED) (0 secs / 0.425 secs
PhantomJS 1.9.1 (Windows 7): Executed 158 of 201 (1 FAILED) (0 secs / 0.426 secs
PhantomJS 1.9.1 (Windows 7): Executed 159 of 201 (1 FAILED) (0 secs / 0.427 secs
PhantomJS 1.9.1 (Windows 7): Executed 160 of 201 (1 FAILED) (0 secs / 0.429 secs
PhantomJS 1.9.1 (Windows 7): Executed 161 of 201 (1 FAILED) (0 secs / 0.43 secs)
PhantomJS 1.9.1 (Windows 7): Executed 162 of 201 (1 FAILED) (0 secs / 0.432 secs
PhantomJS 1.9.1 (Windows 7): Executed 163 of 201 (1 FAILED) (0 secs / 0.433 secs
PhantomJS 1.9.1 (Windows 7): Executed 164 of 201 (1 FAILED) (0 secs / 0.434 secs
PhantomJS 1.9.1 (Windows 7): Executed 165 of 201 (1 FAILED) (0 secs / 0.436 secs
PhantomJS 1.9.1 (Windows 7): Executed 166 of 201 (1 FAILED) (0 secs / 0.437 secs
PhantomJS 1.9.1 (Windows 7): Executed 167 of 201 (1 FAILED) (0 secs / 0.438 secs

这非常烦人,因为我必须向上滚动很长时间以查看1次失败测试中的实际错误。 我们是三个人运行相同的解决方案和相同的karma.conf文件。我们两个人遇到了这个问题。另一个没有。

到目前为止,我尝试重新安装业力无济于事。是否有一些环境设置我搞砸了什么?

1 个答案:

答案 0 :(得分:1)

我修改了这个问题,方法是将我的karma.config.js文件更改为“#dot;'报告。我不太喜欢样式的变化,当测试失败时,我的终端不再是页面长。

我的旧选择:

reporters: ['progress']

我的新选择:

reporters: ['dots']