1 | module.exports = require('should');
|
2 |
|
3 | var Schema = require('jugglingdb').Schema;
|
4 |
|
5 | global.getConfig = function(options) {
|
6 |
|
7 | var dbConf = {
|
8 | database: 'myapp_test',
|
9 | username: 'root'
|
10 | };
|
11 |
|
12 | if (options) {
|
13 | for (var el in options) {
|
14 | dbConf[el] = options[el]
|
15 | }
|
16 | }
|
17 |
|
18 | return dbConf;
|
19 | }
|
20 |
|
21 | global.getSchema = function(options) {
|
22 | var db = new Schema(require('../'), getConfig(options));
|
23 | return db;
|
24 | };
|