How to run QUnit tests from command line?(如何从命令行运行 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
这篇关于如何从命令行运行 QUnit 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从命令行运行 QUnit 测试?
基础教程推荐
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01