Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Added `make mocha.css` target. Closes #45

Tj Holowaychuk96b7bd9f3c6a
diff --git a/Makefile b/Makefile
index 90f7da24..a7ac7f67 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,11 @@ TM_DEST = ~/Library/Application\ Support/TextMate/Bundles
TM_BUNDLE = JavaScript\ mocha.tmbundle
SRC = $(shell find lib -name "*.js" -type f)
+all: mocha.js mocha.css
+
+mocha.css: test/browser/style.css
+ cp -f $< $@
+
mocha.js: $(SRC)
@node support/compile $^
@cat support/tail.js >> mocha.js
diff --git a/mocha.css b/mocha.css
new file mode 100644
index 00000000..756d668a
--- /dev/null
+++ b/mocha.css
@@ -0,0 +1,91 @@
+
+body {
+ font: 20px/1.5 "Helvetica Neue", Helvetica, Aria;, sans-serif;
+ padding: 60px 50px;
+}
+
+h1, h2 {
+ margin: 0;
+}
+
+h1 {
+ font-size: 1em;
+ font-weight: 200;
+}
+
+.suite .suite h1 {
+ font-size: .8em;
+}
+
+h2 {
+ font-size: 12px;
+ font-weight: normal;
+ cursor: pointer;
+}
+
+.suite {
+ margin-left: 15px;
+}
+
+.test {
+ margin-left: 15px;
+}
+
+.test.pass::before {
+ content: '◦';
+ font-size: 12px;
+ display: block;
+ float: left;
+ margin-right: 5px;
+}
+
+.test.fail {
+ color: #c00;
+}
+
+.test.fail pre {
+ color: black;
+}
+
+.test.fail::before {
+ content: '✖';
+ font-size: 12px;
+ display: block;
+ float: left;
+ margin-right: 5px;
+ color: #c00;
+}
+
+.test pre.error {
+ color: #c00;
+}
+
+.test pre {
+ display: inline-block;
+ font: 12px/1.5 monaco, monospace;
+ margin: 5px;
+ padding: 15px;
+ border: 1px solid #eee;
+ border-bottom-color: #ddd;
+ -webkit-border-radius: 3px;
+ -webkit-box-shadow: 0 1px 3px #eee;
+}
+
+#error {
+ color: #c00;
+ font-size: 1.5 em;
+ font-weight: 100;
+ letter-spacing: 1px;
+}
+
+#stats {
+ position: fixed;
+ top: 15px;
+ right: 30px;
+ font-size: 12px;
+ margin: 0;
+}
+
+#stats li {
+ list-style: none;
+}
\ No newline at end of file
diff --git a/mocha.js b/mocha.js
index cb575d96..74fce15f 100644
--- a/mocha.js
+++ b/mocha.js
@@ -781,7 +781,7 @@ function HTML(runner) {
, stack = [root]
, stat = $(statsTemplate).appendTo(root);
- if (root.length) return error('#mocha div missing, add it to your document');
+ if (!root.length) return error('#mocha div missing, add it to your document');
runner.on('suite', function(suite){
if (suite.root) return;