2013-09-05 16:36:49 -04:00
|
|
|
global.sinon = require("sinon");
|
2013-05-04 02:57:12 -04:00
|
|
|
|
2014-04-16 01:23:50 -04:00
|
|
|
var chai = global.chai = require("chai");
|
2013-09-12 13:30:47 -04:00
|
|
|
|
2013-09-05 16:36:49 -04:00
|
|
|
chai.use(require("chai-as-promised"));
|
|
|
|
chai.use(require("sinon-chai"));
|
|
|
|
chai.should();
|
2013-06-09 13:50:43 -04:00
|
|
|
|
2014-05-28 22:29:34 -04:00
|
|
|
var Promise = global.testPromise = require('../lib/promise');
|
2013-09-05 16:36:49 -04:00
|
|
|
global.expect = chai.expect;
|
|
|
|
global.AssertionError = chai.AssertionError;
|
|
|
|
global.Assertion = chai.Assertion;
|
|
|
|
global.assert = chai.assert;
|
2013-12-27 14:44:21 -05:00
|
|
|
global.d = new Date;
|
2013-03-19 20:28:03 -04:00
|
|
|
|
2013-10-27 22:34:58 -04:00
|
|
|
Promise.longStackTraces();
|
|
|
|
|
2013-12-27 14:44:21 -05:00
|
|
|
var knex = require('../knex');
|
2013-09-08 15:57:32 -04:00
|
|
|
|
2014-08-26 17:16:46 +02:00
|
|
|
var clients = {
|
|
|
|
maria: {
|
|
|
|
name: 'maria',
|
|
|
|
client: knex({client: 'maria'}).client,
|
|
|
|
alias: 'mysql'
|
|
|
|
},
|
|
|
|
mysql: {
|
|
|
|
name: 'mysql',
|
|
|
|
client: knex({client: 'mysql'}).client,
|
|
|
|
},
|
|
|
|
sqlite3: {
|
|
|
|
name: 'sqlite3',
|
|
|
|
client: knex({client: 'sqlite3'}).client
|
|
|
|
},
|
|
|
|
postgres: {
|
|
|
|
name: 'postgres',
|
|
|
|
client: knex({client: 'postgres'}).client,
|
|
|
|
},
|
|
|
|
oracle: {
|
|
|
|
name: 'oracle',
|
|
|
|
client: knex({client: 'oracle'}).client,
|
|
|
|
}
|
|
|
|
};
|
2013-09-11 23:36:55 -04:00
|
|
|
|
2014-04-16 11:38:03 -04:00
|
|
|
describe('Unit tests', function() {
|
2014-08-26 17:16:46 +02:00
|
|
|
Object.keys(clients).forEach(function (clientName) {
|
|
|
|
require('./unit/schema/' + (clients[clientName].alias || clients[clientName].name))(clients[clientName].client);
|
|
|
|
require('./unit/query/builder')(function () { return new clients[clientName].client.QueryBuilder(); }, clients[clientName].name, clients[clientName].alias);
|
|
|
|
});
|
2014-04-16 11:38:03 -04:00
|
|
|
});
|
|
|
|
|
2013-12-27 14:44:21 -05:00
|
|
|
// Integration Tests
|
|
|
|
describe('Integration Tests', function() {
|
2014-06-03 00:47:54 -04:00
|
|
|
require('./integration')(this);
|
2013-09-08 15:57:32 -04:00
|
|
|
});
|