integration tests all running in the same process were stepping on eachother. each test file is now run within its own node processremotes/origin/v0.6.x
parent
f34470db41
commit
af997d914b
@ -0,0 +1,18 @@
|
||||
SHELL := /bin/bash
|
||||
|
||||
user=postgres
|
||||
password=1234
|
||||
host=localhost
|
||||
port=5432
|
||||
database=postgres
|
||||
|
||||
test-unit:
|
||||
@find test/unit -name "*-tests.js" | xargs -n 1 -I file node file
|
||||
|
||||
test-integration:
|
||||
@find test/integration -name "*-tests.js" | xargs -n 1 -I file node file -u $(user) --password $(password) -p $(port) -d $(database) -h $(host)
|
||||
|
||||
test-all: test-unit test-integration
|
||||
test: test-unit
|
||||
|
||||
.PHONY : test
|
@ -1,25 +0,0 @@
|
||||
|
||||
//executes all the unit tests
|
||||
var fs = require('fs');
|
||||
|
||||
var args = require(__dirname + '/cli');
|
||||
|
||||
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]);
|
||||
});
|
||||
};
|
||||
|
||||
var arg = args.test;
|
||||
|
||||
if(arg == 'all') {
|
||||
runDir(__dirname+'/unit/');
|
||||
runDir(__dirname+'/integration/');
|
||||
}
|
||||
else {
|
||||
runDir(__dirname+'/' + arg + '/');
|
||||
}
|
||||
|
Loading…
Reference in new issue