Browse files

setting up mocha tests

  • Loading branch information...
1 parent 07307d0 commit 760e767a0a013de39abd2c74813783eb8b4d986e @tj tj committed Nov 8, 2011
Showing with 16 additions and 4 deletions.
  1. +11 −1 Makefile
  2. +1 −1 Readme.md
  3. +4 −2 package.json
  4. 0 test/node/superagent.js
View
12 Makefile
@@ -1,15 +1,25 @@
SRC = lib/events.js lib/superagent.js
+TESTS = test/node/*.js
+REPORTER = dot
+
all: superagent.js superagent.min.js
+test:
+ @NODE_ENV=test ./node_modules/.bin/mocha \
+ --require should \
+ --reporter $(REPORTER) \
+ --growl \
+ $(TESTS)
+
superagent.js: $(SRC)
cat $^ > $@
superagent.min.js: superagent.js
uglifyjs --no-mangle $< > $@
-test:
+test-server:
@node test/server
docs: lib
View
2 Readme.md
@@ -88,7 +88,7 @@ request.post('/api/pet', cat, function(res){
Start the test server:
- $ make test
+ $ make test-server
Visit `localhost:3000/` in the browser.
View
6 package.json
@@ -5,10 +5,12 @@
, "keywords": ["http", "ajax", "request", "agent"]
, "author": "TJ Holowaychuk <tj@vision-media.ca>"
, "dependencies": {
- "qs": "0.3.1"
+ "qs": "0.3.1"
}
, "devDependencies": {
- "express": "2.4.4"
+ "express": "2.5.0"
+ , "should": "0.3.2"
+ , "mocha": "0.0.1-alpha1"
}
, "main": "index"
, "engines": { "node": ">= 0.4.0 < 0.7.0" }
View
0 test/node/superagent.js
No changes.

0 comments on commit 760e767

Please sign in to comment.