loopback-connector-mysql/test/init.js

25 lines
460 B
JavaScript
Raw Normal View History

2013-04-07 21:53:55 +00:00
module.exports = require('should');
2013-03-27 00:37:13 +00:00
var Schema = require('jugglingdb').Schema;
global.getConfig = function(options) {
var dbConf = {
2013-03-27 00:37:13 +00:00
database: 'myapp_test',
username: 'root'
};
if (options) {
for (var el in options) {
dbConf[el] = options[el]
}
}
return dbConf;
}
global.getSchema = function(options) {
var db = new Schema(require('../'), getConfig(options));
2013-03-27 00:37:13 +00:00
return db;
};