如何从命令行运行 QUnit 测试?

我最近开始开发一个 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.

目前我正在尝试使用 teaspoon 但我还没有设法让它工作.任何帮助将非常感激.如果我需要发布有关设置的更多信息,请告诉我.

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.

推荐答案

node-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

相关文章