node-query/tests/adapters/pg_test_skip.js

37 lines
828 B
JavaScript
Raw Normal View History

2014-10-23 10:53:16 -04:00
'use strict';
// Load the test base
delete require.cache[require.resolve('../query-builder-base')];
var testBase = require('../query-builder-base');
var tests = testBase.tests;
// Load the test config file
var adapterName = 'pg';
var config = require('../config.json')[adapterName];
// Set up the connection
var pg = require(adapterName);
var connection = new pg.Client(config.conn);
// Set up the query builder object
var nodeQuery = require('../../lib/node-query');
var qb = nodeQuery('pg', connection, adapterName);
// Set up the test base
testBase._setUp(qb, function(test, err, result) {
2014-10-23 10:53:16 -04:00
if (err) {
throw new Error(err);
}
test.ok.call(test, result);
2014-10-23 10:53:16 -04:00
});
// Export the final test object
tests["pg adapter with query builder"] = function(test) {
test.ok(testBase.qb);
test.done();
};
module.exports = tests;