Ember-cli: importing blanket.js causes test runners to hang

社会主义新天地 提交于 2019-12-07 12:30:04

问题


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 install blanket

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/blanket/dist/qunit/blanket.js');

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

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

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

Ember CLI Code Coverage Reports

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/25907782/ember-cli-importing-blanket-js-causes-test-runners-to-hang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!