diff --git a/CHANGES.md b/CHANGES.md index 9fa7298..ffccb43 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,8 @@ ## bunyan 0.5.2 (not yet released) -(nothing yet) +- Start a test suite. + ## bunyan 0.5.1 diff --git a/Makefile b/Makefile index 2f98c88..687294c 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,25 @@ +#---- Tools + +TAP := ./node_modules/.bin/tap + + +#---- Targets + all: -# Ensure jsontool.js and package.json have the same version. +# Ensure all version-carrying files have the same version. +.PHONY: versioncheck versioncheck: [[ `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}'` ]] @echo Version check ok. +.PHONY: cutarelease cutarelease: versioncheck ./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 + diff --git a/package.json b/package.json index 20af61f..837a5da 100644 --- a/package.json +++ b/package.json @@ -12,5 +12,9 @@ "url": "git://github.com/trentm/node-bunyan.git" }, "engines": ["node >=0.4.0"], - "keywords": ["log", "logging", "log4j", "json"] + "keywords": ["log", "logging", "log4j", "json"], + + "devDependencies": { + "tap": "0.2.0" + } } diff --git a/test/ctor.test.js b/test/ctor.test.js new file mode 100644 index 0000000..81e9d9b --- /dev/null +++ b/test/ctor.test.js @@ -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(); +}); + +