From cc428910c76457d3a3bb61a0c7eb106e2137a108 Mon Sep 17 00:00:00 2001 From: Chase Brammer Date: Sat, 31 Dec 2011 13:17:00 -0700 Subject: [PATCH] Mocha test framework - Added in the Mocha test framework to npm - Added in the test folder, and a basic pending test - Added in a make file to run the tests via: make test --- initproject.sh | 3 +++ templates/app/Makefile | 10 ++++++++++ templates/app/package.json | 4 +++- templates/test/stub.js | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 templates/app/Makefile create mode 100644 templates/test/stub.js diff --git a/initproject.sh b/initproject.sh index 7da71cd..f0f1843 100755 --- a/initproject.sh +++ b/initproject.sh @@ -6,12 +6,15 @@ mkdir ./static/css mkdir ./static/js mkdir ./views mkdir ./models +mkdir ./test echo "Copying Markup and CSS BoilerPlate..." cp ./templates/app/server.js ./server.js cp ./templates/app/package.json ./package.json cp ./templates/app/.gitignore ./.gitignore cp ./templates/app/config.json ./config.json +cp ./templates/app/Makefile ./Makefile +cp ./templates/test/stub.js ./test/stub.js curl https://raw.github.com/h5bp/html5-boilerplate/master/css/style.css > ./static/css/style.css cp ./templates/views/500.jade ./views/500.jade cp ./templates/views/404.jade ./views/404.jade diff --git a/templates/app/Makefile b/templates/app/Makefile new file mode 100644 index 0000000..8f4030a --- /dev/null +++ b/templates/app/Makefile @@ -0,0 +1,10 @@ +TESTS = test/*.js + +test: + @NODE_ENV=test ./node_modules/.bin/mocha \ + --require should \ + --reporter list \ + --slow 20 \ + --growl \ + $(TESTS) +.PHONY: test \ No newline at end of file diff --git a/templates/app/package.json b/templates/app/package.json index de46418..a25ee94 100644 --- a/templates/app/package.json +++ b/templates/app/package.json @@ -11,7 +11,9 @@ "socket.io": "0.8.7" }, "devDependencies": { - "vows": "0.5.x" + "vows": "0.5.x", + "mocha": "*", + "should": "*" }, "engine": "node >= 0.6.6" } diff --git a/templates/test/stub.js b/templates/test/stub.js new file mode 100644 index 0000000..e93765a --- /dev/null +++ b/templates/test/stub.js @@ -0,0 +1,7 @@ +describe('stub', function(){ + + describe('#test', function(){ + it('should have some units tests') + }) + +})