2016-11-10 20:15:16 -05:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
(() => {
|
|
|
|
// Load the test base
|
|
|
|
const path = require('path');
|
|
|
|
const reload = require('require-reload')(require);
|
|
|
|
const testBase = reload('../base');
|
|
|
|
const expect = reload('chai').expect;
|
2016-11-10 22:10:45 -05:00
|
|
|
const testRunner = testBase.promiseTestRunner;
|
2016-11-10 20:15:16 -05:00
|
|
|
|
|
|
|
// Skip on CI
|
|
|
|
if (process.env.CI || process.env.TRAVIS) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load the test config file
|
|
|
|
let adapterName = 'node-firebird';
|
|
|
|
let Firebird = reload(adapterName);
|
|
|
|
const config = reload('../config.json')[adapterName];
|
|
|
|
config.connection.database = path.join(__dirname, config.connection.database);
|
|
|
|
let nodeQuery = reload('../../lib/NodeQuery')(config);
|
|
|
|
|
|
|
|
let qb = nodeQuery.getQuery();
|
|
|
|
|
|
|
|
suite('Firebird adapter tests -', () => {
|
|
|
|
test('nodeQuery.getQuery = nodeQuery.init', () => {
|
|
|
|
expect(nodeQuery.getQuery())
|
|
|
|
.to.be.deep.equal(qb);
|
|
|
|
});
|
|
|
|
test('insertBatch throws error', () => {
|
|
|
|
expect(() => {
|
|
|
|
qb.driver.insertBatch('create_test', []);
|
|
|
|
}).to.throw(Error, 'Not Implemented');
|
|
|
|
});
|
|
|
|
|
2016-11-10 22:10:45 -05:00
|
|
|
testRunner(qb);
|
2016-11-10 20:15:16 -05:00
|
|
|
|
|
|
|
suiteTeardown(() => {
|
|
|
|
qb.end();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})();
|