如何从命令行运行QUnit测试? [英] How to run QUnit tests from command line?
问题描述
我最近开始研究一个Rails应用程序,它已经有大量的QUnit测试用于测试ember。我被指控使用CI设置应用程序(我决定使用CodeShip)。我目前面临的问题是,运行qunit测试的唯一方法是转到 http:// localhost:3000 / qunit
。我需要设置一种从命令行运行测试的方法。我做了大量的研究,尝试了至少10种不同的解决方案,但没有成功。
I recently started working on a Rails app that has a large amount of QUnit tests already in place for testing ember. I have been charged with the task of setting the app with a CI (I decided to use CodeShip). The issue I currently face is that the only way for me to run the qunit tests is to go to http://localhost:3000/qunit
. I need to setup a way to run the tests from the command line. I have done a large amount of research, and have tried at least 10 different solutions but non have managed to work.
目前我正在尝试使用茶匙但它我没有设法让它工作。任何帮助将非常感激。如果我需要发布有关设置的更多信息,请告诉我。
Currently I am attempting to use teaspoon but it I have not managed to get it to work. Any help would be much appreciated. Please let me know if I need to post more information about the setup.
推荐答案
节点-qunit-phantomjs 可以轻松完成工作并且是独立的,而不是Grunt-,Gulp-,无论插件:
node-qunit-phantomjs gets the job done easy enough and is standalone, not a Grunt-, Gulp-, whatever-plugin:
$ npm install -g node-qunit-phantomjs
$ node-qunit-phantomjs tests.html
Testing tests.html
Took 8 ms to run 1 tests. 0 passed, 1 failed.
...
$ echo $?
1
这篇关于如何从命令行运行QUnit测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!