start a test suite

This commit is contained in:
Trent Mick 2012-02-08 10:05:56 -08:00
parent 18c6fc6cef
commit 450e4eb434
4 changed files with 37 additions and 3 deletions

View file

@ -2,7 +2,8 @@
## bunyan 0.5.2 (not yet released) ## bunyan 0.5.2 (not yet released)
(nothing yet) - Start a test suite.
## bunyan 0.5.1 ## bunyan 0.5.1

View file

@ -1,12 +1,25 @@
#---- Tools
TAP := ./node_modules/.bin/tap
#---- Targets
all: all:
# Ensure jsontool.js and package.json have the same version. # Ensure all version-carrying files have the same version.
.PHONY: versioncheck
versioncheck: versioncheck:
[[ `cat package.json | json version` == `grep '^var VERSION' bin/bunyan | awk -F'"' '{print $$2}'` ]] [[ `cat package.json | json version` == `grep '^var VERSION' bin/bunyan | awk -F'"' '{print $$2}'` ]]
[[ `cat package.json | json version` == `grep '^var VERSION' lib/bunyan.js | awk -F'"' '{print $$2}'` ]] [[ `cat package.json | json version` == `grep '^var VERSION' lib/bunyan.js | awk -F'"' '{print $$2}'` ]]
@echo Version check ok. @echo Version check ok.
.PHONY: cutarelease
cutarelease: versioncheck cutarelease: versioncheck
./tools/cutarelease.py -p bunyan -f package.json -f lib/bunyan.js -f bin/bunyan ./tools/cutarelease.py -p bunyan -f package.json -f lib/bunyan.js -f bin/bunyan
.PHONY: test
test: $(TAP)
TAP=1 $(TAP) test/*.test.js

View file

@ -12,5 +12,9 @@
"url": "git://github.com/trentm/node-bunyan.git" "url": "git://github.com/trentm/node-bunyan.git"
}, },
"engines": ["node >=0.4.0"], "engines": ["node >=0.4.0"],
"keywords": ["log", "logging", "log4j", "json"] "keywords": ["log", "logging", "log4j", "json"],
"devDependencies": {
"tap": "0.2.0"
}
} }

16
test/ctor.test.js Normal file
View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2012, Trent Mick. All rights reserved.
*
* Test type checking on creation of the Logger.
*/
var test = require('tap').test;
var Logger = require('../lib/bunyan');
test("douglas adams", function(t) {
t.ok(42, "the answer to life the universe and everything");
t.end();
});