2016-11-18 21:59:22 -05:00
|
|
|
/* eslint-env node, mocha */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Load the test base
|
|
|
|
const path = require('path');
|
|
|
|
const reload = require('require-reload')(require);
|
|
|
|
const testBase = reload('../base');
|
|
|
|
const expect = testBase.expect;
|
|
|
|
const testRunner = testBase.promiseTestRunner;
|
|
|
|
|
|
|
|
// Skip on CI
|
|
|
|
if (!(process.env.CI || process.env.TRAVIS)) {
|
|
|
|
// Load the test config file
|
|
|
|
let adapterName = 'node-firebird';
|
|
|
|
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();
|
|
|
|
|
2017-02-28 15:47:29 -05:00
|
|
|
describe('Firebird adapter tests -', () => {
|
|
|
|
it('nodeQuery.getQuery = nodeQuery.init', () => {
|
2016-11-18 21:59:22 -05:00
|
|
|
expect(nodeQuery.getQuery())
|
|
|
|
.to.be.deep.equal(qb);
|
|
|
|
});
|
2017-02-28 15:47:29 -05:00
|
|
|
it('insertBatch throws error', () => {
|
2016-11-18 21:59:22 -05:00
|
|
|
expect(() => {
|
|
|
|
qb.driver.insertBatch('create_test', []);
|
|
|
|
}).to.throw(Error, 'Not Implemented');
|
|
|
|
});
|
|
|
|
|
|
|
|
testRunner(qb);
|
|
|
|
|
2017-02-28 15:47:29 -05:00
|
|
|
afterAll(() => {
|
2016-11-18 21:59:22 -05:00
|
|
|
qb.end();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|