Skip to content

Commit cf82eec

Browse files
committed
修正一些测试
1 parent 5878ce4 commit cf82eec

8 files changed

+2022
-12
lines changed

shiu_dev.asciidoc

+6
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ http://127.0.0.1:9999/jiangye/
170170
来转换文本格式。
171171
运行 `./manager.py --help` 可以查看到帮助。
172172

173+
=== QUnit ===
174+
175+
jQuery 团队出的 JavaScript 单元测试工具。
176+
177+
* http://docs.jquery.com/QUnit
178+
173179
=== JSLint ===
174180

175181
使用 JSLint 来控制 Javascript 质量。

test/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<script src="http://code.jquery.com/jquery-latest.js"></script>
6-
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
7-
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>
5+
<script src="jquery-1.7.2.min.js"></script>
6+
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" />
7+
<script type="text/javascript" src="qunit.js"></script>
88

99
<!--<script type="text/javascript" src="../js/zepto.js"></script>-->
1010
<!--<script type="text/javascript" src="../js/iscroll.js"></script>-->
@@ -21,7 +21,7 @@
2121
<script>
2222
window.shiu.test = {};
2323
$(document).ready(function () {
24-
window.localStorage.clear();
24+
window.localStorage.clear(); // 清空本地数据
2525
var p = window.shiu.test;
2626
p.TestChapter();
2727
p.TestBook();

test/jquery-1.7.2.min.js

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/qunit.css

+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
/**
2+
* QUnit v1.6.0pre - A JavaScript Unit Testing Framework
3+
*
4+
* http://docs.jquery.com/QUnit
5+
*
6+
* Copyright (c) 2012 John Resig, Jörn Zaefferer
7+
* Dual licensed under the MIT (MIT-LICENSE.txt)
8+
* or GPL (GPL-LICENSE.txt) licenses.
9+
*/
10+
11+
/** Font Family and Sizes */
12+
13+
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
14+
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
15+
}
16+
17+
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
18+
#qunit-tests { font-size: smaller; }
19+
20+
21+
/** Resets */
22+
23+
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
24+
margin: 0;
25+
padding: 0;
26+
}
27+
28+
29+
/** Header */
30+
31+
#qunit-header {
32+
padding: 0.5em 0 0.5em 1em;
33+
34+
color: #8699a4;
35+
background-color: #0d3349;
36+
37+
font-size: 1.5em;
38+
line-height: 1em;
39+
font-weight: normal;
40+
41+
border-radius: 15px 15px 0 0;
42+
-moz-border-radius: 15px 15px 0 0;
43+
-webkit-border-top-right-radius: 15px;
44+
-webkit-border-top-left-radius: 15px;
45+
}
46+
47+
#qunit-header a {
48+
text-decoration: none;
49+
color: #c2ccd1;
50+
}
51+
52+
#qunit-header a:hover,
53+
#qunit-header a:focus {
54+
color: #fff;
55+
}
56+
57+
#qunit-header label {
58+
display: inline-block;
59+
}
60+
61+
#qunit-banner {
62+
height: 5px;
63+
}
64+
65+
#qunit-testrunner-toolbar {
66+
padding: 0.5em 0 0.5em 2em;
67+
color: #5E740B;
68+
background-color: #eee;
69+
}
70+
71+
#qunit-userAgent {
72+
padding: 0.5em 0 0.5em 2.5em;
73+
background-color: #2b81af;
74+
color: #fff;
75+
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
76+
}
77+
78+
79+
/** Tests: Pass/Fail */
80+
81+
#qunit-tests {
82+
list-style-position: inside;
83+
}
84+
85+
#qunit-tests li {
86+
padding: 0.4em 0.5em 0.4em 2.5em;
87+
border-bottom: 1px solid #fff;
88+
list-style-position: inside;
89+
}
90+
91+
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
92+
display: none;
93+
}
94+
95+
#qunit-tests li strong {
96+
cursor: pointer;
97+
}
98+
99+
#qunit-tests li a {
100+
padding: 0.5em;
101+
color: #c2ccd1;
102+
text-decoration: none;
103+
}
104+
#qunit-tests li a:hover,
105+
#qunit-tests li a:focus {
106+
color: #000;
107+
}
108+
109+
#qunit-tests ol {
110+
margin-top: 0.5em;
111+
padding: 0.5em;
112+
113+
background-color: #fff;
114+
115+
border-radius: 15px;
116+
-moz-border-radius: 15px;
117+
-webkit-border-radius: 15px;
118+
119+
box-shadow: inset 0px 2px 13px #999;
120+
-moz-box-shadow: inset 0px 2px 13px #999;
121+
-webkit-box-shadow: inset 0px 2px 13px #999;
122+
}
123+
124+
#qunit-tests table {
125+
border-collapse: collapse;
126+
margin-top: .2em;
127+
}
128+
129+
#qunit-tests th {
130+
text-align: right;
131+
vertical-align: top;
132+
padding: 0 .5em 0 0;
133+
}
134+
135+
#qunit-tests td {
136+
vertical-align: top;
137+
}
138+
139+
#qunit-tests pre {
140+
margin: 0;
141+
white-space: pre-wrap;
142+
word-wrap: break-word;
143+
}
144+
145+
#qunit-tests del {
146+
background-color: #e0f2be;
147+
color: #374e0c;
148+
text-decoration: none;
149+
}
150+
151+
#qunit-tests ins {
152+
background-color: #ffcaca;
153+
color: #500;
154+
text-decoration: none;
155+
}
156+
157+
/*** Test Counts */
158+
159+
#qunit-tests b.counts { color: black; }
160+
#qunit-tests b.passed { color: #5E740B; }
161+
#qunit-tests b.failed { color: #710909; }
162+
163+
#qunit-tests li li {
164+
margin: 0.5em;
165+
padding: 0.4em 0.5em 0.4em 0.5em;
166+
background-color: #fff;
167+
border-bottom: none;
168+
list-style-position: inside;
169+
}
170+
171+
/*** Passing Styles */
172+
173+
#qunit-tests li li.pass {
174+
color: #5E740B;
175+
background-color: #fff;
176+
border-left: 26px solid #C6E746;
177+
}
178+
179+
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
180+
#qunit-tests .pass .test-name { color: #366097; }
181+
182+
#qunit-tests .pass .test-actual,
183+
#qunit-tests .pass .test-expected { color: #999999; }
184+
185+
#qunit-banner.qunit-pass { background-color: #C6E746; }
186+
187+
/*** Failing Styles */
188+
189+
#qunit-tests li li.fail {
190+
color: #710909;
191+
background-color: #fff;
192+
border-left: 26px solid #EE5757;
193+
white-space: pre;
194+
}
195+
196+
#qunit-tests > li:last-child {
197+
border-radius: 0 0 15px 15px;
198+
-moz-border-radius: 0 0 15px 15px;
199+
-webkit-border-bottom-right-radius: 15px;
200+
-webkit-border-bottom-left-radius: 15px;
201+
}
202+
203+
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
204+
#qunit-tests .fail .test-name,
205+
#qunit-tests .fail .module-name { color: #000000; }
206+
207+
#qunit-tests .fail .test-actual { color: #EE5757; }
208+
#qunit-tests .fail .test-expected { color: green; }
209+
210+
#qunit-banner.qunit-fail { background-color: #EE5757; }
211+
212+
213+
/** Result */
214+
215+
#qunit-testresult {
216+
padding: 0.5em 0.5em 0.5em 2.5em;
217+
218+
color: #2b81af;
219+
background-color: #D2E0E6;
220+
221+
border-bottom: 1px solid white;
222+
}
223+
#qunit-testresult .module-name {
224+
font-weight: bold;
225+
}
226+
227+
/** Fixture */
228+
229+
#qunit-fixture {
230+
position: absolute;
231+
top: -10000px;
232+
left: -10000px;
233+
width: 1000px;
234+
height: 1000px;
235+
}

0 commit comments

Comments
 (0)