Skip to content

Commit 268dd6b

Browse files
authored
Merge pull request stringer-rss#457 from pascalw/fix-mocha-tests
Fix mocha tests
2 parents 4b21f68 + e3c9eab commit 268dd6b

File tree

4 files changed

+13419
-2429
lines changed

4 files changed

+13419
-2429
lines changed

.tool-versions

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 2.3.3

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ before_install:
22
- gem update bundler
33
- 'echo "RUBY_VERSION: $RUBY_VERSION"'
44
before_script:
5-
- npm install -g mocha-phantomjs@2.0.2
5+
- npm install -g mocha-phantomjs@4.1.0
66
- bundle exec rake test_js &> /dev/null &
77
- sleep 5
88
cache: bundler

spec/javascript/support/vendor/css/mocha.css

+101-23
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
@charset "utf-8";
22

33
body {
4+
margin:0;
5+
}
6+
7+
#mocha {
48
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
5-
padding: 60px 50px;
9+
margin: 60px 50px;
610
}
711

8-
#mocha ul, #mocha li {
12+
#mocha ul,
13+
#mocha li {
914
margin: 0;
1015
padding: 0;
1116
}
@@ -14,7 +19,8 @@ body {
1419
list-style: none;
1520
}
1621

17-
#mocha h1, #mocha h2 {
22+
#mocha h1,
23+
#mocha h2 {
1824
margin: 0;
1925
}
2026

@@ -38,7 +44,7 @@ body {
3844
font-size: .8em;
3945
}
4046

41-
.hidden {
47+
#mocha .hidden {
4248
display: none;
4349
}
4450

@@ -59,15 +65,15 @@ body {
5965

6066
#mocha .test.pending:hover h2::after {
6167
content: '(pending)';
62-
font-family: arial;
68+
font-family: arial, sans-serif;
6369
}
6470

6571
#mocha .test.pass.medium .duration {
66-
background: #C09853;
72+
background: #c09853;
6773
}
6874

6975
#mocha .test.pass.slow .duration {
70-
background: #B94A48;
76+
background: #b94a48;
7177
}
7278

7379
#mocha .test.pass::before {
@@ -83,7 +89,7 @@ body {
8389
font-size: 9px;
8490
margin-left: 5px;
8591
padding: 2px 5px;
86-
color: white;
92+
color: #fff;
8793
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
8894
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
8995
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
@@ -128,23 +134,73 @@ body {
128134
color: #c00;
129135
max-height: 300px;
130136
overflow: auto;
131-
max-width: 600px;
132137
}
133138

134-
#mocha .test pre {
139+
#mocha .test .html-error {
140+
overflow: auto;
141+
color: black;
142+
line-height: 1.5;
135143
display: block;
136144
float: left;
137145
clear: left;
138146
font: 12px/1.5 monaco, monospace;
139147
margin: 5px;
140148
padding: 15px;
141149
border: 1px solid #eee;
150+
max-width: 85%; /*(1)*/
151+
max-width: -webkit-calc(100% - 42px);
152+
max-width: -moz-calc(100% - 42px);
153+
max-width: calc(100% - 42px); /*(2)*/
154+
max-height: 300px;
155+
word-wrap: break-word;
142156
border-bottom-color: #ddd;
143-
-webkit-border-radius: 3px;
144157
-webkit-box-shadow: 0 1px 3px #eee;
158+
-moz-box-shadow: 0 1px 3px #eee;
159+
box-shadow: 0 1px 3px #eee;
160+
-webkit-border-radius: 3px;
145161
-moz-border-radius: 3px;
162+
border-radius: 3px;
163+
}
164+
165+
#mocha .test .html-error pre.error {
166+
border: none;
167+
-webkit-border-radius: 0;
168+
-moz-border-radius: 0;
169+
border-radius: 0;
170+
-webkit-box-shadow: 0;
171+
-moz-box-shadow: 0;
172+
box-shadow: 0;
173+
padding: 0;
174+
margin: 0;
175+
margin-top: 18px;
176+
max-height: none;
177+
}
178+
179+
/**
180+
* (1): approximate for browsers not supporting calc
181+
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
182+
* ^^ seriously
183+
*/
184+
#mocha .test pre {
185+
display: block;
186+
float: left;
187+
clear: left;
188+
font: 12px/1.5 monaco, monospace;
189+
margin: 5px;
190+
padding: 15px;
191+
border: 1px solid #eee;
192+
max-width: 85%; /*(1)*/
193+
max-width: -webkit-calc(100% - 42px);
194+
max-width: -moz-calc(100% - 42px);
195+
max-width: calc(100% - 42px); /*(2)*/
196+
word-wrap: break-word;
197+
border-bottom-color: #ddd;
198+
-webkit-box-shadow: 0 1px 3px #eee;
146199
-moz-box-shadow: 0 1px 3px #eee;
147-
white-space: pre-wrap;
200+
box-shadow: 0 1px 3px #eee;
201+
-webkit-border-radius: 3px;
202+
-moz-border-radius: 3px;
203+
border-radius: 3px;
148204
}
149205

150206
#mocha .test h2 {
@@ -164,10 +220,12 @@ body {
164220
text-align: center;
165221
background: #eee;
166222
font-size: 15px;
223+
-webkit-border-radius: 15px;
167224
-moz-border-radius: 15px;
168225
border-radius: 15px;
169-
-webkit-transition: opacity 200ms;
170-
-moz-transition: opacity 200ms;
226+
-webkit-transition:opacity 200ms;
227+
-moz-transition:opacity 200ms;
228+
-o-transition:opacity 200ms;
171229
transition: opacity 200ms;
172230
opacity: 0.3;
173231
color: #888;
@@ -185,9 +243,17 @@ body {
185243
display: none;
186244
}
187245

246+
#mocha-report.pending .test.pass,
247+
#mocha-report.pending .test.fail {
248+
display: none;
249+
}
250+
#mocha-report.pending .test.pass.pending {
251+
display: block;
252+
}
253+
188254
#mocha-error {
189255
color: #c00;
190-
font-size: 1.5 em;
256+
font-size: 1.5em;
191257
font-weight: 100;
192258
letter-spacing: 1px;
193259
}
@@ -199,11 +265,23 @@ body {
199265
font-size: 12px;
200266
margin: 0;
201267
color: #888;
268+
z-index: 1;
202269
}
203270

204271
#mocha-stats .progress {
205272
float: right;
206273
padding-top: 0;
274+
275+
/**
276+
* Set safe initial values, so mochas .progress does not inherit these
277+
* properties from Bootstrap .progress (which causes .progress height to
278+
* equal line height set in Bootstrap).
279+
*/
280+
height: auto;
281+
-webkit-box-shadow: none;
282+
-moz-box-shadow: none;
283+
box-shadow: none;
284+
background-color: initial;
207285
}
208286

209287
#mocha-stats em {
@@ -231,18 +309,18 @@ body {
231309
height: 40px;
232310
}
233311

234-
code .comment { color: #ddd }
235-
code .init { color: #2F6FAD }
236-
code .string { color: #5890AD }
237-
code .keyword { color: #8A6343 }
238-
code .number { color: #2F6FAD }
312+
#mocha code .comment { color: #ddd; }
313+
#mocha code .init { color: #2f6fad; }
314+
#mocha code .string { color: #5890ad; }
315+
#mocha code .keyword { color: #8a6343; }
316+
#mocha code .number { color: #2f6fad; }
239317

240318
@media screen and (max-device-width: 480px) {
241-
body {
242-
padding: 60px 0px;
319+
#mocha {
320+
margin: 60px 0px;
243321
}
244322

245-
#stats {
323+
#mocha #stats {
246324
position: absolute;
247325
}
248326
}

0 commit comments

Comments
 (0)