Skip to content

Commit

Permalink
interim commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Hiller committed Sep 13, 2014
1 parent a4cf699 commit 1a0d885
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6,094 deletions.
42 changes: 20 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ REPORTER ?= spec
TM_BUNDLE = JavaScript\ mocha.tmbundle
SRC = $(shell find lib -name "*.js" -type f | sort)
SUPPORT = $(wildcard support/*.js)
REQUIRE ?= index

all: mocha.js

Expand All @@ -15,23 +16,19 @@ lib/browser/escape-string-regexp.js: node_modules/escape-string-regexp/index.js
mocha.js: $(SRC) $(SUPPORT) lib/browser/diff.js lib/browser/escape-string-regexp.js
@node support/compile $(SRC)
@cat \
support/head.js \
_mocha.js \
support/tail.js \
support/foot.js \
> mocha.js
support/head.js \
_mocha.js \
support/tail.js \
support/foot.js \
> mocha.js

clean:
rm -f mocha.js
rm -fr lib-cov
rm -f coverage.html

test-cov: lib-cov
@COV=1 $(MAKE) test REPORTER=html-cov > coverage.html

lib-cov:
@rm -fr ./$@
@jscoverage lib $@
test-cov:
$(MAKE) test REPORTER=html-cov REQUIRE=blanket > coverage.html

test: test-unit

Expand All @@ -41,8 +38,9 @@ test-jsapi:
@node test/jsapi

test-unit:
@./bin/mocha \
./bin/mocha \
--reporter $(REPORTER) \
--require $(REQUIRE) \
test/acceptance/*.js \
--growl \
test/*.js
Expand Down Expand Up @@ -101,16 +99,16 @@ test-exports:

test-grep:
@./bin/mocha \
--reporter $(REPORTER) \
--grep fast \
test/acceptance/misc/grep
--reporter $(REPORTER) \
--grep fast \
test/acceptance/misc/grep

test-invert:
@./bin/mocha \
--reporter $(REPORTER) \
--grep slow \
--invert \
test/acceptance/misc/grep
--reporter $(REPORTER) \
--grep slow \
--invert \
test/acceptance/misc/grep

test-bail:
@./bin/mocha \
Expand All @@ -120,9 +118,9 @@ test-bail:

test-async-only:
@./bin/mocha \
--reporter $(REPORTER) \
--async-only \
test/acceptance/misc/asyncOnly
--reporter $(REPORTER) \
--async-only \
test/acceptance/misc/asyncOnly

test-glob:
@./test/acceptance/glob/glob.sh
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@

module.exports = process.env.COV
? require('./lib-cov/mocha')
: require('./lib/mocha');
module.exports = require('./lib/mocha');
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ exports.highlightTags = function(name) {
*/

exports.stringify = function(obj) {
if (obj instanceof RegExp) return obj.toString();
if (obj instanceof RegExp || obj instanceof Date) return obj.toString();
return JSON.stringify(exports.canonicalize(obj), null, 2).replace(/,(\n|$)/g, '$1');
}

Expand Down
Loading

0 comments on commit 1a0d885

Please sign in to comment.