node-query/test/adapters/node-firebird_test.js

46 lines
1.2 KiB
JavaScript
Raw Normal View History

2015-12-07 12:03:42 -05:00
'use strict';
// Load the test base
let reload = require('require-reload')(require);
let expect = reload('chai').expect;
let tests = reload('./adapterTestBase').tests;
let testRunner = reload('./adapterTestBase').runner;
// Load the test config file
let adapterName = 'node-firebird';
let Firebird = reload(adapterName);
let config = reload('../config.json')[adapterName];
config.conn.database = __dirname + config.conn.database;
let nodeQuery = reload('../../lib/NodeQuery');
// Skip on TravisCi
if (process.env.CI || process.env.JENKINS_HOME)
{
return;
}
suite('Firebird adapter tests', () => {
Firebird.attach(config.conn, (err, db) => {
// Set up the query builder object
let qb = nodeQuery.init('firebird', db, adapterName);
testRunner(tests, qb, (err, done) => {
expect(err).is.not.ok;
done();
});
suite('Adapter-specific tests', () => {
test('nodeQuery.getQuery = nodeQuery.init', () => {
expect(nodeQuery.getQuery())
.to.be.deep.equal(qb);
});
2015-12-07 14:33:48 -05:00
test('insertBatch throws error', () => {
expect(() => {
qb.driver.insertBatch('create_test', []);
}).to.throw(Error, "Not Implemented");
});
2015-12-07 12:03:42 -05:00
});
suiteTeardown(() => {
db.detach();
});
});
});