噶测试报告快速奔跑,但实际运行速度慢 [英] Karma tests reporting fast runs, but actually running slow

查看:209
本文介绍了噶测试报告快速奔跑,但实际运行速度慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是最好的视频(或参阅下面的GIF):

This is best explained with a video (or see the gif below):

您会注意到进度噶记者报告说,试验正在毫秒,但它显然是采取相当长的一段......

You'll notice that the Karma progress reporter is reporting that the tests are taking milliseconds, but it's obviously taking quite a while...

我啾啾这个并的被告知

尝试打开调试页面,并打开devtools产生时序应该告诉你那里的放缓发生

Try opening the debug page, and open the devtools to generate timings that should show you where the slow down happens

下面是视频。我不知道他们的意思是产生时序......

So here's a video of that. I'm not sure what they mean by "generate timings..."

有时候,我的人缘测试运行速度非常快,我期望(和它的报道)。有时,它运行很慢,但它表示,它以毫秒为单位运行。这可能发生,即使我用 describe.only 上的测试极少数(但同样,不是所有的时间)。我觉得这个情况多的时间越长我已经运行(观察者)的测试。

Sometimes my karma tests run very quickly as I would expect (and as it's reported). Sometimes it runs really slow, but it says it's running in milliseconds. This can happen even if I use describe.only on a small handful of tests (but again, not all the time). I think this happens more often the longer I have the tests running (the watcher).

我使用,的的WebPack ,ES6(与通天)的因缘摩卡,的兴农

I'm using angular, webpack, es6 (with babel), karma, mocha, chai, and sinon.

我注意到,即使我建立我的测试,而不果报的WebPack插件,然后在结果上运行的因缘,我仍然看到这个问题(所以我不认为这是果报的WebPack插件)。

I notice that even if I build my tests without the karma-webpack plugin and then run karma on the result, I still see this problem (so I don't think it's the karma-webpack plugin).

上面的视频是我的测试套件对我的工作项目(我们正在覆盖工作...)。但是,我在开源项目这是建立和角度formly 有时发现同样的问题在大致相同的方式进行测试。这是一个非常小codeBase类(2K左右线相比,30K线)。

The videos above are my test suite for my work project (we're working on coverage...). But I notice this same problem sometimes in my open source project angular-formly which is built and tested in much the same way. It's a much smaller codebase (around 2k lines compared to 30k lines).

所以,我的问题是,为什么它报告说,它的运行超快,但不实际运行超级快,我怎么能使其运行速度快?

So, my question is, why is it reporting that it's running super fast, but not actually running super fast and how can I make it run fast?

推荐答案

的问题是类似这个问题。不过,它看起来像Chrome浏览器必须是在前台(也许href=\"https://twitter.com/jeffbcross/status/609385356329226240\" rel=\"nofollow\">近期变化一个

The problem is similar to this issue. However, it looks like Chrome needs to be in the foreground (maybe a recent change?)... I don't see the problem in Firefox.

所以,解决的办法是使用Firefox代替。

So, the solution is to use Firefox instead.

不过,如果Chrome需要具体使用,你可以阅读另一个问题我张贴解决此问题得到解决

However, if Chrome needs to be used specifically, you can read another question I posted to address getting around this issue.

这篇关于噶测试报告快速奔跑,但实际运行速度慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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