Permalink
Browse files

allow running specific tests

  • Loading branch information...
1 parent 3304511 commit 3b819534d5de570461b988ca56742d7780119cb2 @aheckmann committed Jan 11, 2012
Showing with 4 additions and 1 deletion.
  1. +1 −1 Makefile
  2. +3 −0 test/index.js
View
@@ -1,5 +1,5 @@
test:
- @node test/
+ @node test/ $(TESTS)
.PHONY: test
View
@@ -7,12 +7,15 @@ var assert = require('assert');
var gleak = require('gleak')();
var fs = require('fs');
+var only = process.argv.slice(2);
+
var files = fs.readdirSync(__dirname).filter(filter);
var pending, total = pending = files.length;
function filter (file) {
if (!/\.js$/.test(file)) return false;
if ('index.js' === file) return false;
+ if (only.length && !~only.indexOf(file)) return false;
var filename = __dirname + '/' + file;
if (!fs.statSync(filename).isFile()) return false;

0 comments on commit 3b81953

Please sign in to comment.