Skip to content

Commit

Permalink
Refactor too much for one commit
Browse files Browse the repository at this point in the history
Refactored tests for tagCount to be more thorough. Previous tests lumped too much into one test.
Has now been expanded into three separate tests. Refactored using before/after hooks to cleanup
inidividual tests. Separating into multiple tests also helps prevent ChaiJS from timing out on one
very expensive test.

Added FizzBuzz prompt along with tests.
Began refactoring existing tests for before/after hooks.
Began adding tests restricting allowed number of arguments.
  • Loading branch information
mybrainishuge committed Nov 30, 2016
1 parent 8ebe636 commit 8d66869
Show file tree
Hide file tree
Showing 8 changed files with 33,875 additions and 19,422 deletions.
8,062 changes: 4,754 additions & 3,308 deletions lib/chai.js
100755 → 100644

Large diffs are not rendered by default.

127 changes: 106 additions & 21 deletions lib/css/mocha.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
@charset "utf-8";

body {
margin:0;
}

#mocha {
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 60px 50px;
margin: 60px 50px;
}

#mocha ul, #mocha li {
#mocha ul,
#mocha li {
margin: 0;
padding: 0;
}
Expand All @@ -14,7 +19,8 @@ body {
list-style: none;
}

#mocha h1, #mocha h2 {
#mocha h1,
#mocha h2 {
margin: 0;
}

Expand All @@ -38,7 +44,7 @@ body {
font-size: .8em;
}

.hidden {
#mocha .hidden {
display: none;
}

Expand All @@ -59,15 +65,15 @@ body {

#mocha .test.pending:hover h2::after {
content: '(pending)';
font-family: arial;
font-family: arial, sans-serif;
}

#mocha .test.pass.medium .duration {
background: #C09853;
background: #c09853;
}

#mocha .test.pass.slow .duration {
background: #B94A48;
background: #b94a48;
}

#mocha .test.pass::before {
Expand All @@ -83,7 +89,7 @@ body {
font-size: 9px;
margin-left: 5px;
padding: 2px 5px;
color: white;
color: #fff;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
Expand Down Expand Up @@ -130,19 +136,71 @@ body {
overflow: auto;
}

#mocha .test pre {
#mocha .test .html-error {
overflow: auto;
color: black;
line-height: 1.5;
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: -webkit-calc(100% - 42px);
max-width: -moz-calc(100% - 42px);
max-width: calc(100% - 42px); /*(2)*/
max-height: 300px;
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-border-radius: 3px;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-box-shadow: 0 1px 3px #eee;
box-shadow: 0 1px 3px #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

#mocha .test .html-error pre.error {
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: 0;
-moz-box-shadow: 0;
box-shadow: 0;
padding: 0;
margin: 0;
margin-top: 18px;
max-height: none;
}

/**
* (1): approximate for browsers not supporting calc
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
* ^^ seriously
*/
#mocha .test pre {
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: -webkit-calc(100% - 42px);
max-width: -moz-calc(100% - 42px);
max-width: calc(100% - 42px); /*(2)*/
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-box-shadow: 0 1px 3px #eee;
box-shadow: 0 1px 3px #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

#mocha .test h2 {
Expand All @@ -162,10 +220,12 @@ body {
text-align: center;
background: #eee;
font-size: 15px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-transition: opacity 200ms;
-moz-transition: opacity 200ms;
-webkit-transition:opacity 200ms;
-moz-transition:opacity 200ms;
-o-transition:opacity 200ms;
transition: opacity 200ms;
opacity: 0.3;
color: #888;
Expand All @@ -183,9 +243,17 @@ body {
display: none;
}

#mocha-report.pending .test.pass,
#mocha-report.pending .test.fail {
display: none;
}
#mocha-report.pending .test.pass.pending {
display: block;
}

#mocha-error {
color: #c00;
font-size: 1.5 em;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 1px;
}
Expand All @@ -197,11 +265,23 @@ body {
font-size: 12px;
margin: 0;
color: #888;
z-index: 1;
}

#mocha-stats .progress {
float: right;
padding-top: 0;

/**
* Set safe initial values, so mochas .progress does not inherit these
* properties from Bootstrap .progress (which causes .progress height to
* equal line height set in Bootstrap).
*/
height: auto;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-color: initial;
}

#mocha-stats em {
Expand All @@ -224,18 +304,23 @@ body {
padding-top: 11px;
}

code .comment { color: #ddd }
code .init { color: #2F6FAD }
code .string { color: #5890AD }
code .keyword { color: #8A6343 }
code .number { color: #2F6FAD }
#mocha-stats canvas {
width: 40px;
height: 40px;
}

#mocha code .comment { color: #ddd; }
#mocha code .init { color: #2f6fad; }
#mocha code .string { color: #5890ad; }
#mocha code .keyword { color: #8a6343; }
#mocha code .number { color: #2f6fad; }

@media screen and (max-device-width: 480px) {
body {
padding: 60px 0px;
#mocha {
margin: 60px 0px;
}

#stats {
#mocha #stats {
position: absolute;
}
}
Loading

0 comments on commit 8d66869

Please sign in to comment.