Unit tests, written with [QUnit](http://docs.jquery.com/QUnit), are used to
expose bugs for squashing, prevent bugs from respawning, and suppress new
bugs when adding new features and making changes.
# Running the tests
The simplest way to run the tests is to open `tests/tests.html` in your browser.
The test suites will automatically run themselves and present their results.
To run the tests from the command line, download and install
[PhantomJS](http://phantomjs.org/), and run `run-qunit.js` with it:
$ cd tests/
$ phantomjs run-qunit.js tests.html
Failed tests and their failed assertions will be printed to the console. A
results summary will be printed at the end.
To generate coverage statistics, use [JSCoverage](http://siliconforks.com/jscoverage/)
to instrument the js files:
$ cd tests/
$ jscoverage ../js/ ../instrumented/
$ phantomjs run-qunit.js tests.html
Coverage percentage will be included in the output summary, and a highlighted
line-by-line html file will be generated.
# Shout-out
Thanks to Rod @ While One Fork for the
[CIS guide](http://whileonefork.blogspot.com/2011/10/integrating-javascript-tests-into-cli.html)
on putting the above together.
# Adding tests
Tests go in js files in the `tests/suites/` directory tree. QUnit organizes
tests into suites called "modules"; there is one module per js file. If the
tests you are adding do not fit into an existing module, create a new one at
`tests/suites/<new module>.js`, where `<new module>` is a broad yet
descriptive name for the suite. If tests have many year-specific cases (ie,
behave differently in leap years vs normal years, or have specific buggy
behavior in a certain year), create the module in a new directory,
`tests/suites/<new module>/<year>.js`, where `<new module>` is the decriptive
name and `<year>` is the four-digit year the tests pertain to.
In order for new tests to be run, they must be imported into `tests/tests.html`.
Find the script includes headed by the html comment `<!-- Test suites -->`, and
add a new one to the list which includes the new js files.
# Can I use this?
By all means, please do! Just note that I stopped working on this structure
once it fit my needs, there's no real support for it, and it may change in the
future. Otherwise, have at it.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Python基于django的旅游网站源代码+数据库初始化脚本 (245个子文件)
3083cc3.css 235KB
bootstrap.css 143KB
bootstrap.css 140KB
bootstrap.min.css 121KB
bootstrap.min.css 119KB
bootstrap.css 117KB
bootstrap.min.css 95KB
font-awesome.css 37KB
font-awesome.min.css 30KB
bootstrap-theme.css 25KB
bootstrap-theme.min.css 23KB
videocontrols.css 20KB
bootstrap-theme.css 16KB
0c4bd8c.css 16KB
bootstrap-theme.min.css 15KB
bootstrap-datetimepicker.css 12KB
bootstrap-datetimepicker.min.css 11KB
1b880b7.css 9KB
qunit.css 5KB
Female_version_of_the_style.css 429B
products.css 237B
quan.css 96B
fontawesome-webfont.eot 162KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 14KB
.gitattributes 483B
.gitignore 182B
.gitignore 67B
The_motherboard.html 5KB
home_page.html 5KB
Products_Services.html 4KB
The_dashboard.html 4KB
The_motherboard_session.html 4KB
index.html 3KB
index.html 3KB
jingdian_list.html 3KB
user_list.html 3KB
Department_management.html 2KB
tests.min.html 2KB
tests.html 2KB
login.html 2KB
jingdian.html 1KB
Department_management_xinjian.html 1KB
user_xinjian.html 1KB
user_bianji.html 1KB
jingdian_bianji.html 1KB
information_xiugai.html 1KB
Department_management_bianji.html 983B
jiangdian_chakan.html 782B
information.html 664B
user_chakan.html 536B
_coverage.html 326B
logo.ico 22KB
shixun_jectpro.iml 1KB
beijing.jpeg 3.56MB
information.jpeg 116KB
homepage-campaign-kv-mc.jpg 399KB
home.jpg 39KB
echarts.min.js 760KB
0779396.js 214KB
jquery-1.7.1.min.js 92KB
jquery-1.8.3.min.js 91KB
jquery-1.8.3.min.js 91KB
jquery-3.3.1.min.js 85KB
bootstrap.js 74KB
bootstrap-datetimepicker.js 68KB
bootstrap.js 57KB
bootstrap.js 57KB
qunit.js 43KB
bootstrap.min.js 39KB
bootstrap-datetimepicker.min.js 38KB
bootstrap.min.js 27KB
bootstrap.min.js 26KB
options.js 15KB
2012.js 14KB
2012.js 11KB
formats.js 8KB
component.js 6KB
run-qunit.js 6KB
2011.js 3KB
events.js 3KB
2011.js 2KB
coverage.js 2KB
bootstrap-datetimepicker.bn.js 1KB
bootstrap-datetimepicker.ka.js 1KB
all.js 1KB
qunit-logging.js 1KB
bootstrap-datetimepicker.th.js 1KB
bootstrap-datetimepicker.ar.js 940B
bootstrap-datetimepicker.el.js 928B
bootstrap-datetimepicker.uk.js 927B
bootstrap-datetimepicker.hy.js 914B
bootstrap-datetimepicker.ru.js 904B
bootstrap-datetimepicker.bg.js 874B
bootstrap-datetimepicker.ua.js 874B
bootstrap-datetimepicker.rs.js 873B
mock.js 854B
bootstrap-datetimepicker.zh-CN.js 813B
bootstrap-datetimepicker.zh-TW.js 813B
bootstrap-datetimepicker.sw.js 811B
共 245 条
- 1
- 2
- 3
资源评论
程序员柳
- 粉丝: 6624
- 资源: 1443
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 程氏舞曲V4.2程氏舞曲V4.2程氏舞曲V4.2程氏舞曲V4.2
- FPGA读写 AD9708+ AD9280 ADDA实验Verilog逻辑源码Quartus工程文件+文档说明+硬件参考原理图
- 基于CH340C设计USB转TLL串口通信模块PADS 9.5设计硬件(原理图+PCB)文件.zip
- 信号与系统大作业-图像处理 实现了直接滤波法维纳滤波法最小二乘滤波法LR递归法matlab源码.zip
- php-leetcode题解之最小栈.zip
- php-leetcode题解之最长不含重复字符的子字符串.zip
- php-leetcode题解之最长公共前缀.zip
- php-leetcode题解之最小差值.zip
- php-leetcode题解之最小基因变化.zip
- php-leetcode题解之最小路径和.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功