Skip to content

Commit 763ce7f

Browse files
committed
Update to latest version of QUnit and install jsDump parser for Base objects.
1 parent b4ff0d3 commit 763ce7f

3 files changed

Lines changed: 1715 additions & 917 deletions

File tree

test/lib/helpers.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010
* All rights reserved.
1111
*/
1212

13+
// Register a jsDump parser for Base and override object parser to handle it
14+
15+
var objectParser = QUnit.jsDump.parsers.object;
16+
17+
QUnit.jsDump.setParser('Base', function (obj, stack) {
18+
return obj.toString();
19+
});
20+
21+
QUnit.jsDump.setParser('object', function (obj, stack) {
22+
return (obj instanceof Base
23+
? QUnit.jsDump.parsers.Base
24+
: objectParser).call(this, obj, stack);
25+
});
26+
1327
// Override equals to convert functions to message and execute them as tests()
1428
function equals(actual, expected, message, tolerance) {
1529
if (typeof actual === 'function') {

test/lib/qunit/qunit.css

Lines changed: 76 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
/**
2+
* QUnit v1.11.0 - A JavaScript Unit Testing Framework
3+
*
4+
* http://qunitjs.com
5+
*
6+
* Copyright 2012 jQuery Foundation and other contributors
7+
* Released under the MIT license.
8+
* http://jquery.org/license
9+
*/
10+
111
/** Font Family and Sizes */
212

313
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
4-
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
14+
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
515
}
616

717
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
@@ -10,7 +20,7 @@
1020

1121
/** Resets */
1222

13-
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
23+
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
1424
margin: 0;
1525
padding: 0;
1626
}
@@ -27,11 +37,11 @@
2737
font-size: 1.5em;
2838
line-height: 1em;
2939
font-weight: normal;
30-
31-
border-radius: 15px 15px 0 0;
32-
-moz-border-radius: 15px 15px 0 0;
33-
-webkit-border-top-right-radius: 15px;
34-
-webkit-border-top-left-radius: 15px;
40+
41+
border-radius: 5px 5px 0 0;
42+
-moz-border-radius: 5px 5px 0 0;
43+
-webkit-border-top-right-radius: 5px;
44+
-webkit-border-top-left-radius: 5px;
3545
}
3646

3747
#qunit-header a {
@@ -44,6 +54,11 @@
4454
color: #fff;
4555
}
4656

57+
#qunit-testrunner-toolbar label {
58+
display: inline-block;
59+
padding: 0 .5em 0 .1em;
60+
}
61+
4762
#qunit-banner {
4863
height: 5px;
4964
}
@@ -52,6 +67,7 @@
5267
padding: 0.5em 0 0.5em 2em;
5368
color: #5E740B;
5469
background-color: #eee;
70+
overflow: hidden;
5571
}
5672

5773
#qunit-userAgent {
@@ -61,6 +77,9 @@
6177
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
6278
}
6379

80+
#qunit-modulefilter-container {
81+
float: right;
82+
}
6483

6584
/** Tests: Pass/Fail */
6685

@@ -74,23 +93,42 @@
7493
list-style-position: inside;
7594
}
7695

96+
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
97+
display: none;
98+
}
99+
77100
#qunit-tests li strong {
78101
cursor: pointer;
79102
}
80103

81-
#qunit-tests ol {
104+
#qunit-tests li a {
105+
padding: 0.5em;
106+
color: #c2ccd1;
107+
text-decoration: none;
108+
}
109+
#qunit-tests li a:hover,
110+
#qunit-tests li a:focus {
111+
color: #000;
112+
}
113+
114+
#qunit-tests li .runtime {
115+
float: right;
116+
font-size: smaller;
117+
}
118+
119+
.qunit-assert-list {
82120
margin-top: 0.5em;
83121
padding: 0.5em;
84-
122+
85123
background-color: #fff;
86-
87-
border-radius: 15px;
88-
-moz-border-radius: 15px;
89-
-webkit-border-radius: 15px;
90-
91-
box-shadow: inset 0px 2px 13px #999;
92-
-moz-box-shadow: inset 0px 2px 13px #999;
93-
-webkit-box-shadow: inset 0px 2px 13px #999;
124+
125+
border-radius: 5px;
126+
-moz-border-radius: 5px;
127+
-webkit-border-radius: 5px;
128+
}
129+
130+
.qunit-collapsed {
131+
display: none;
94132
}
95133

96134
#qunit-tests table {
@@ -133,8 +171,7 @@
133171
#qunit-tests b.failed { color: #710909; }
134172

135173
#qunit-tests li li {
136-
margin: 0.5em;
137-
padding: 0.4em 0.5em 0.4em 0.5em;
174+
padding: 5px;
138175
background-color: #fff;
139176
border-bottom: none;
140177
list-style-position: inside;
@@ -143,14 +180,14 @@
143180
/*** Passing Styles */
144181

145182
#qunit-tests li li.pass {
146-
color: #5E740B;
183+
color: #3c510c;
147184
background-color: #fff;
148-
border-left: 26px solid #C6E746;
185+
border-left: 10px solid #C6E746;
149186
}
150187

151188
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
152189
#qunit-tests .pass .test-name { color: #366097; }
153-
190+
154191
#qunit-tests .pass .test-actual,
155192
#qunit-tests .pass .test-expected { color: #999999; }
156193

@@ -161,7 +198,15 @@
161198
#qunit-tests li li.fail {
162199
color: #710909;
163200
background-color: #fff;
164-
border-left: 26px solid #EE5757;
201+
border-left: 10px solid #EE5757;
202+
white-space: pre;
203+
}
204+
205+
#qunit-tests > li:last-child {
206+
border-radius: 0 0 5px 5px;
207+
-moz-border-radius: 0 0 5px 5px;
208+
-webkit-border-bottom-right-radius: 5px;
209+
-webkit-border-bottom-left-radius: 5px;
165210
}
166211

167212
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
@@ -174,18 +219,18 @@
174219
#qunit-banner.qunit-fail { background-color: #EE5757; }
175220

176221

177-
/** Footer */
222+
/** Result */
178223

179224
#qunit-testresult {
180225
padding: 0.5em 0.5em 0.5em 2.5em;
181226

182227
color: #2b81af;
183228
background-color: #D2E0E6;
184229

185-
border-radius: 0 0 15px 15px;
186-
-moz-border-radius: 0 0 15px 15px;
187-
-webkit-border-bottom-right-radius: 15px;
188-
-webkit-border-bottom-left-radius: 15px;
230+
border-bottom: 1px solid white;
231+
}
232+
#qunit-testresult .module-name {
233+
font-weight: bold;
189234
}
190235

191236
/** Fixture */
@@ -194,4 +239,6 @@
194239
position: absolute;
195240
top: -10000px;
196241
left: -10000px;
197-
}
242+
width: 1000px;
243+
height: 1000px;
244+
}

0 commit comments

Comments
 (0)