node-postgres/test.js

13 lines
363 B
JavaScript
Raw Normal View History

2010-10-24 07:24:27 +08:00
#! /usr/local/bin/node
2010-10-11 07:50:05 +08:00
//executes all the unit tests
var fs = require('fs');
2010-10-24 07:20:29 +08:00
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]);
});
};
2010-10-24 07:22:55 +08:00
runDir(__dirname+'/test/' + (process.argv[2] || "unit")+ '/');