Fix conditional loading of firebird test for travis-ci

This commit is contained in:
Timothy Warren 2014-11-04 12:52:02 -05:00
parent d554372912
commit 7ef2385da9

View File

@ -14,17 +14,11 @@ try {
var Firebird = require(adapterName); var Firebird = require(adapterName);
var conn = null; var conn = null;
var qb = null; var qb = null;
} catch (e) {
// Export an empty testBase.testsuite if module not loaded
console.log(e);
console.log("Database adapter firebird not found");
module.exports = {};
}
// Setup testbase from the inside out // Setup testbase from the inside out
// Because the connection is async, utilize // Because the connection is async, utilize
// the setUp function from nodeunit to get the connection // the setUp function from nodeunit to get the connection
testBase.tests.setUp = function(cb) { testBase.tests.setUp = function(cb) {
if ( ! conn) if ( ! conn)
{ {
// Connect to the database // Connect to the database
@ -57,10 +51,10 @@ testBase.tests.setUp = function(cb) {
{ {
cb(); cb();
} }
}; };
//delete testBase.tests['DB update tests']; //delete testBase.tests['DB update tests'];
testBase.tests['DB update tests']['Test Insert Batch'] = function(test) { testBase.tests['DB update tests']['Test Insert Batch'] = function(test) {
test.expect(1); test.expect(1);
test.throws(function() { test.throws(function() {
@ -68,9 +62,9 @@ testBase.tests['DB update tests']['Test Insert Batch'] = function(test) {
}, Error, "Insert Batch not implemented for firebird"); }, Error, "Insert Batch not implemented for firebird");
test.done(); test.done();
}; };
testBase.tests["firebird adapter with query builder"] = function(test) { testBase.tests["firebird adapter with query builder"] = function(test) {
test.expect(1); test.expect(1);
test.ok(testBase.qb); test.ok(testBase.qb);
@ -78,6 +72,13 @@ testBase.tests["firebird adapter with query builder"] = function(test) {
conn.detach(); conn.detach();
test.done(); test.done();
}; };
module.exports = testBase.tests; module.exports = testBase.tests;
} catch (e) {
// Export an empty testBase.testsuite if module not loaded
console.log(e);
console.log("Database adapter firebird not found");
module.exports = {};
}