node-postgres/test.js
2010-10-23 18:24:27 -05:00

13 lines
363 B
JavaScript
Executable File

#! /usr/local/bin/node
//executes all the unit tests
var fs = require('fs');
var runDir = function(dir) {
fs.readdirSync(dir).forEach(function(file) {
if(file.indexOf(".js") < 0) {
return runDir(fs.realpathSync(dir + file) + "/");
}
require(dir + file.split('.js') [0]);
});
};
runDir(__dirname+'/test/' + (process.argv[2] || "unit")+ '/');