Ember-Cli:导入Blank.js导致测试运行程序挂起 [英] Ember-cli: importing blanket.js causes test runners to hang

查看:83
本文介绍了Ember-Cli:导入Blank.js导致测试运行程序挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将ember-cli和ember-qUnit一起用于测试。我还想将代码覆盖率结果添加到测试输出中,因此在进行了一些研究之后,lanketjs似乎是要走的路。我使用以下方法安装了毯子:

I'm currently using ember-cli with ember-qUnit for testing. I would also like to add code coverage results to the test output, so after some research blanketjs seemed the way to go. I installed blanket using:


npm安装毯子

npm install blanket

并将毯子文件夹移动到ember-cli供应商文件夹。据我了解,导入库的方式是通过Brocfile.js进行的,

And moved the blanket folder into the ember-cli vendor folder. As I understand the way to import libraries is through the Brocfile.js which I am doing like so:


app.import('vendor /毯子/dist/qunit/blanket.js');

app.import('vendor/blanket/dist/qunit/blanket.js');

使用灰烬检查器,似乎毯子已正确导入,并且启用覆盖复选框已显示在qUnit测试结果页面的顶部。但是测试只是挂起,只是说正在运行。似乎没有运行测试。当我使用时:

Using ember inspector it appears that blanket has been imported correctly, and the "enable coverage" checkbox has appeared at the top of the qUnit test results page. However the tests just hang and just say "running". No tests seem to run. When I use:


ember test -server

ember test -server

它表示正在等待跑步者。有谁知道这里可能出什么问题吗?

It says that it is "waiting for runners". Does anyone know what could be going wrong here?

我环顾四周,似乎用ember-cli进行代码覆盖是一个棘手的问题:

I've looked around and it seems code-coverage with ember-cli is a tricky subject:

Ember CLI代码覆盖率报告

谢谢

推荐答案

我使用 ember-cli-blanket 。我认为您不需要将其包含在您的 Brocfile.js 中,而是将其导入到您的 tests / index.html 导入您的 test-support.js 后。

I installed it using ember-cli-blanket. I don't think you need to include it in your Brocfile.js, but instead import it in your tests/index.html after you import your test-support.js.

毯子可能会使您的跑步者垂涎很大,因为它实际上是在重新加载整个应用程序。

Blanket will probably make your runners hang for a big as it is essentially loading you entire app all over again.

对于它的价值,我仍然无法使用此方法获得准确的测试范围,但这可能是用户错误。

For what it's worth, I haven't been able to get accurate test coverage using this method yet, but it's possibly user error.

这篇关于Ember-Cli:导入Blank.js导致测试运行程序挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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