mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Update test styles.
This commit is contained in:
parent
e7d97d4b66
commit
239157df30
3 changed files with 143 additions and 186 deletions
|
@ -11,7 +11,7 @@ html
|
||||||
script( src="scripts.js" )
|
script( src="scripts.js" )
|
||||||
|
|
||||||
body
|
body
|
||||||
|
div#report
|
||||||
|
a( href='index.html' ) h5ai #{pkg.version} test suite
|
||||||
div#mocha-overlay
|
div#mocha-overlay
|
||||||
div#report
|
|
||||||
a( href='index.html' ) h5ai #{pkg.version} test suite
|
|
||||||
div#mocha
|
div#mocha
|
||||||
|
|
323
test/styles.less
323
test/styles.less
|
@ -5,50 +5,51 @@
|
||||||
@col-green: #4caf50;
|
@col-green: #4caf50;
|
||||||
@col-grey: #555;
|
@col-grey: #555;
|
||||||
|
|
||||||
#mocha-overlay {
|
#report {
|
||||||
|
font-family: arial, sans;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
background: @col-grey;
|
||||||
|
z-index: 10000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 32px;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 8px;
|
||||||
|
|
||||||
|
a, a:active, a:visited, a:hover {
|
||||||
|
display: block;
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
&.pass {
|
||||||
|
background: @col-green;
|
||||||
|
}
|
||||||
|
&.fail {
|
||||||
|
background: @col-red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#mocha-overlay {
|
||||||
|
font-family: arial, sans;
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 32px;
|
||||||
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
#report {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
background: @col-grey;
|
|
||||||
z-index: 1;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 32px;
|
|
||||||
padding: 0 8px;
|
|
||||||
|
|
||||||
a, a:active, a:visited, a:hover {
|
|
||||||
display: block;
|
|
||||||
color: #fff;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.pass #report {
|
|
||||||
background: @col-green;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fail #report {
|
|
||||||
background: @col-red;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#mocha {
|
#mocha {
|
||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
margin: 80px auto;
|
margin: 80px auto;
|
||||||
|
|
||||||
ul, li {
|
ul, li, h1, h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
@ -57,34 +58,12 @@
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2 {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
|
||||||
.comment {
|
|
||||||
color: #ddd;
|
|
||||||
}
|
|
||||||
.init {
|
|
||||||
color: #2f6fad;
|
|
||||||
}
|
|
||||||
.string {
|
|
||||||
color: #5890ad;
|
|
||||||
}
|
|
||||||
.keyword {
|
|
||||||
color: #8a6343;
|
|
||||||
}
|
|
||||||
.number {
|
|
||||||
color: #2f6fad;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -101,124 +80,63 @@
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.test.fail, .test pre.error {
|
&.fail {
|
||||||
color: @col-red-text;
|
color: @col-red-text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.test .duration {
|
&::before {
|
||||||
display: inline-block;
|
content: ' ';
|
||||||
color: @col-grey;
|
display: block;
|
||||||
border: none;
|
width: 10px;
|
||||||
box-shadow: none;
|
height: 10px;
|
||||||
font-size: 9px;
|
float: left;
|
||||||
margin-left: 12px;
|
margin-right: 8px;
|
||||||
}
|
background: @col-grey;
|
||||||
|
border-radius: 20px;
|
||||||
|
position: relative;
|
||||||
|
top: 3px;
|
||||||
|
}
|
||||||
|
&.pass::before {
|
||||||
|
background: @col-green;
|
||||||
|
}
|
||||||
|
&.fail::before {
|
||||||
|
background: @col-red;
|
||||||
|
}
|
||||||
|
&.pending::before {
|
||||||
|
background: @col-grey;
|
||||||
|
}
|
||||||
|
|
||||||
.test.medium .duration {
|
.duration {
|
||||||
background: #c09853;
|
display: inline-block;
|
||||||
}
|
color: @col-grey;
|
||||||
|
border: none;
|
||||||
|
box-shadow: none;
|
||||||
|
font-size: 9px;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
&.medium .duration {
|
||||||
|
background: #c09853;
|
||||||
|
}
|
||||||
|
&.slow .duration {
|
||||||
|
background: #b94a48;
|
||||||
|
}
|
||||||
|
|
||||||
.test.slow .duration {
|
pre {
|
||||||
background: #b94a48;
|
display: block;
|
||||||
}
|
float: left;
|
||||||
|
clear: left;
|
||||||
|
font: 12px monospace;
|
||||||
|
margin: 4px 0 16px 18px;
|
||||||
|
padding: 0 8px;
|
||||||
|
max-width: 80%;
|
||||||
|
word-wrap: break-word;
|
||||||
|
border-left: 2px solid @col-grey;
|
||||||
|
|
||||||
.test::before {
|
&.error {
|
||||||
content: ' ';
|
color: @col-red-text;
|
||||||
display: block;
|
}
|
||||||
width: 10px;
|
}
|
||||||
height: 10px;
|
|
||||||
float: left;
|
|
||||||
margin-right: 8px;
|
|
||||||
background: @col-grey;
|
|
||||||
border-radius: 20px;
|
|
||||||
position: relative;
|
|
||||||
top: 3px;
|
|
||||||
}
|
|
||||||
.test.pass::before {
|
|
||||||
background: @col-green;
|
|
||||||
}
|
|
||||||
.test.fail::before {
|
|
||||||
background: @col-red;
|
|
||||||
}
|
|
||||||
.test.pending::before {
|
|
||||||
background: @col-grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.test pre {
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
clear: left;
|
|
||||||
font: 12px monaco, monospace;
|
|
||||||
margin: 4px 0 16px 16px;
|
|
||||||
padding: 4px;
|
|
||||||
max-width: 80%;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#mocha-stats {
|
|
||||||
position: fixed;
|
|
||||||
top: 40px;
|
|
||||||
right: 20px;
|
|
||||||
margin: 0;
|
|
||||||
color: @col-grey;
|
|
||||||
z-index: 1;
|
|
||||||
font-size: 13px;
|
|
||||||
|
|
||||||
em {
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress {
|
|
||||||
float: right;
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
em {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 5px;
|
|
||||||
list-style: none;
|
|
||||||
padding-top: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#mocha-report {
|
|
||||||
|
|
||||||
&.pass .test.fail {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fail .test.pass {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.pending .test.pass,
|
|
||||||
&.pending .test.fail {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
&.pending .test.pass.pending {
|
|
||||||
display: block;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.suite {
|
.suite {
|
||||||
|
@ -262,27 +180,66 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .suite {
|
#mocha-report {
|
||||||
margin: 24px 0;
|
> .suite {
|
||||||
|
margin: 24px 0;
|
||||||
|
|
||||||
> h1 {
|
> h1 {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 24px 0 8px 0;
|
margin: 24px 0 8px 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
> .suite > ul > .suite {
|
> ul > .suite {
|
||||||
margin: 12px 0;
|
margin: 12px 0;
|
||||||
|
|
||||||
> h1 {
|
> h1 {
|
||||||
height: 26px;
|
height: 26px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 16px 0 8px 0;
|
margin: 16px 0 8px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mocha-stats {
|
||||||
|
position: fixed;
|
||||||
|
top: 40px;
|
||||||
|
right: 20px;
|
||||||
|
margin: 0;
|
||||||
|
color: @col-grey;
|
||||||
|
z-index: 1;
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
em {
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 5px;
|
||||||
|
list-style: none;
|
||||||
|
padding-top: 11px;
|
||||||
|
}
|
||||||
|
canvas {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.progress {
|
||||||
|
float: right;
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ function update() {
|
||||||
|
|
||||||
function onEnd() {
|
function onEnd() {
|
||||||
|
|
||||||
$('#mocha-overlay').addClass($('.test.fail').length ? 'fail' : 'pass');
|
$('#report').addClass($('.test.fail').length ? 'fail' : 'pass');
|
||||||
|
|
||||||
$('#mocha-overlay code').each(function () {
|
$('#mocha-overlay code').each(function () {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue