Refine the usage of rc
This commit is contained in:
parent
2b20ccdbd7
commit
9276025bc6
|
@ -3,8 +3,7 @@ config = (config.test && config.test.mysql) || {};
|
|||
|
||||
var DataSource = require('loopback-datasource-juggler').DataSource;
|
||||
|
||||
var config = require('rc')('loopback');
|
||||
config = (config.dev && config.dev.mysql) || {};
|
||||
var config = require('rc')('loopback', {dev: {mysql: {}}}).dev.mysql;
|
||||
|
||||
var ds = new DataSource(require('../'), config);
|
||||
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
var should = require('./init.js');
|
||||
require('./init.js');
|
||||
var assert = require('assert');
|
||||
var Schema = require('loopback-datasource-juggler').Schema;
|
||||
|
||||
var db, settings, adapter, DummyModel, odb;
|
||||
var db, DummyModel, odb;
|
||||
|
||||
describe('migrations', function() {
|
||||
|
||||
|
||||
|
||||
|
||||
before(function() {
|
||||
require('./init.js');
|
||||
|
||||
odb = getSchema({collation: 'utf8_general_ci'});
|
||||
odb = getDataSource({collation: 'utf8_general_ci'});
|
||||
db = odb;
|
||||
});
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
var should = require('./init.js');
|
||||
require('./init.js');
|
||||
var assert = require('assert');
|
||||
var Schema = require('loopback-datasource-juggler').Schema;
|
||||
|
||||
var db, settings, adapter, EnumModel, ANIMAL_ENUM;
|
||||
var db, EnumModel, ANIMAL_ENUM;
|
||||
|
||||
describe('MySQL specific datatypes', function() {
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ module.exports = require('should');
|
|||
|
||||
var DataSource = require('loopback-datasource-juggler').DataSource;
|
||||
|
||||
var config = require('rc')('loopback');
|
||||
config = (config.test && config.test.mysql) || {};
|
||||
var config = require('rc')('loopback', {test: {mysql: {}}}).test.mysql;
|
||||
|
||||
global.getConfig = function(options) {
|
||||
|
||||
|
@ -17,14 +16,14 @@ global.getConfig = function(options) {
|
|||
|
||||
if (options) {
|
||||
for (var el in options) {
|
||||
dbConf[el] = options[el]
|
||||
dbConf[el] = options[el];
|
||||
}
|
||||
}
|
||||
|
||||
return dbConf;
|
||||
}
|
||||
};
|
||||
|
||||
global.getSchema = function(options) {
|
||||
global.getDataSource = global.getSchema = function(options) {
|
||||
var db = new DataSource(require('../'), getConfig(options));
|
||||
return db;
|
||||
};
|
||||
|
|
|
@ -6,11 +6,8 @@ var DataSource = require('loopback-datasource-juggler').DataSource;
|
|||
var db;
|
||||
|
||||
before(function() {
|
||||
var config = require('rc')('loopback');
|
||||
config = (config.dev && config.dev.mysql) || {};
|
||||
|
||||
var config = require('rc')('loopback', {dev: {mysql: {}}}).dev.mysql;
|
||||
db = new DataSource(require('../'), config);
|
||||
|
||||
});
|
||||
|
||||
describe('discoverModels', function() {
|
||||
|
|
Loading…
Reference in New Issue