Merge pull request #313 from strongloop/update-eslint
upgrade eslint deps
This commit is contained in:
commit
94484485b0
|
@ -67,7 +67,8 @@ function mixinMigration(MySQL, mysql) {
|
|||
|
||||
self.getTableStatus(model, function(err, fields, indexes) {
|
||||
self.discoverForeignKeys(self.table(model), {}, function(err, foreignKeys) {
|
||||
if (err) console.log('Failed to discover "' + table + '" foreign keys', err);
|
||||
if (err) console.log('Failed to discover "' + self.table(model) +
|
||||
'" foreign keys', err);
|
||||
|
||||
if (!err && fields && fields.length) {
|
||||
// if we already have a definition, update this table
|
||||
|
@ -144,7 +145,8 @@ function mixinMigration(MySQL, mysql) {
|
|||
async.eachSeries(models, function(model, done) {
|
||||
self.getTableStatus(model, function(err, fields, indexes) {
|
||||
self.discoverForeignKeys(self.table(model), {}, function(err, foreignKeys) {
|
||||
if (err) console.log('Failed to discover "' + table + '" foreign keys', err);
|
||||
if (err) console.log('Failed to discover "' + self.table(model) +
|
||||
'" foreign keys', err);
|
||||
|
||||
self.alterTable(model, fields, indexes, foreignKeys, function(err, needAlter) {
|
||||
if (err) {
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"bluebird": "~2.9.10",
|
||||
"eslint": "^2.13.1",
|
||||
"eslint-config-loopback": "^4.0.0",
|
||||
"eslint": "^4.3.0",
|
||||
"eslint-config-loopback": "^8.0.0",
|
||||
"loopback-datasource-juggler": "^3.0.0",
|
||||
"mocha": "^2.1.0",
|
||||
"rc": "^1.0.0",
|
||||
|
|
|
@ -19,7 +19,8 @@ describe('connections', function() {
|
|||
|
||||
config = global.getConfig();
|
||||
|
||||
odb = getDataSource({collation: 'utf8_general_ci', createDatabase: true});
|
||||
odb = global.getDataSource({collation: 'utf8_general_ci',
|
||||
createDatabase: true});
|
||||
db = odb;
|
||||
});
|
||||
|
||||
|
@ -53,7 +54,7 @@ describe('connections', function() {
|
|||
|
||||
it('should disconnect first db', function(done) {
|
||||
db.disconnect(function() {
|
||||
odb = getDataSource();
|
||||
odb = global.getDataSource();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -112,7 +113,8 @@ function charsetTest(test_set, test_collo, test_set_str, test_set_collo, done) {
|
|||
query('DROP DATABASE IF EXISTS ' + odb.settings.database, function(err) {
|
||||
assert.ok(!err);
|
||||
odb.disconnect(function() {
|
||||
db = getDataSource({collation: test_set_collo, createDatabase: true});
|
||||
db = global.getDataSource({collation: test_set_collo,
|
||||
createDatabase: true});
|
||||
DummyModel = db.define('DummyModel', {string: String});
|
||||
db.automigrate(function() {
|
||||
var q = 'SELECT DEFAULT_COLLATION_NAME' +
|
||||
|
|
|
@ -33,7 +33,7 @@ describe('MySQL specific datatypes', function() {
|
|||
];
|
||||
before(function(done) {
|
||||
require('./init.js');
|
||||
db = getSchema();
|
||||
db = global.getSchema();
|
||||
Account = db.define('Account', {
|
||||
type: {type: String},
|
||||
amount: {
|
||||
|
@ -233,7 +233,7 @@ describe('MySQL specific datatypes', function() {
|
|||
function setup(done) {
|
||||
require('./init.js');
|
||||
|
||||
db = getSchema();
|
||||
db = global.getSchema();
|
||||
|
||||
ANIMAL_ENUM = db.EnumFactory('dog', 'cat', 'mouse');
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ describe('MySQL datetime handling', function() {
|
|||
});
|
||||
}
|
||||
before(function(done) {
|
||||
db = getSchema({
|
||||
db = global.getSchema({
|
||||
dateStrings: true,
|
||||
});
|
||||
Person = db.define('Person', personDefinition, {forceId: true, strict: true});
|
||||
|
|
|
@ -30,7 +30,7 @@ global.getConfig = function(options) {
|
|||
};
|
||||
|
||||
global.getDataSource = global.getSchema = function(options) {
|
||||
var db = new DataSource(require('../'), getConfig(options));
|
||||
var db = new DataSource(require('../'), global.getConfig(options));
|
||||
return db;
|
||||
};
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ describe('migrations', function() {
|
|||
function setup(done) {
|
||||
require('./init.js');
|
||||
|
||||
db = getSchema();
|
||||
db = global.getSchema();
|
||||
|
||||
UserData = db.define('UserData', {
|
||||
email: {type: String, null: false, index: true},
|
||||
|
|
|
@ -9,7 +9,7 @@ require('./init');
|
|||
var ds;
|
||||
|
||||
before(function() {
|
||||
ds = getDataSource();
|
||||
ds = global.getDataSource();
|
||||
});
|
||||
|
||||
describe('MySQL connector', function() {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
process.env.NODE_ENV = 'test';
|
||||
require('should');
|
||||
var should = require('should');
|
||||
|
||||
var assert = require('assert');
|
||||
var DataSource = require('loopback-datasource-juggler').DataSource;
|
||||
|
@ -13,7 +13,7 @@ var db, config;
|
|||
|
||||
before(function(done) {
|
||||
require('./init');
|
||||
config = getConfig();
|
||||
config = global.getConfig();
|
||||
config.database = 'STRONGLOOP';
|
||||
db = new DataSource(require('../'), config);
|
||||
db.once('connected', done);
|
||||
|
@ -43,7 +43,7 @@ describe('discoverModels', function() {
|
|||
done(err);
|
||||
} else {
|
||||
var views = false;
|
||||
should.assert(models.length > 0, 'some models returned');
|
||||
assert(models.length > 0, 'some models returned');
|
||||
models.forEach(function(m) {
|
||||
if (m.type === 'view') {
|
||||
views = true;
|
||||
|
@ -67,7 +67,7 @@ describe('discoverModels', function() {
|
|||
done(err);
|
||||
} else {
|
||||
var views = false;
|
||||
should.assert(models.length > 0, 'some models returned');
|
||||
assert(models.length > 0, 'some models returned');
|
||||
models.forEach(function(m) {
|
||||
assert.equal(m.schema.toLowerCase(), config.database.toLowerCase());
|
||||
});
|
||||
|
@ -88,9 +88,9 @@ describe('discoverModels', function() {
|
|||
console.error(err);
|
||||
done(err);
|
||||
} else {
|
||||
should.assert(models.length > 0, 'some models returned');
|
||||
assert(models.length > 0, 'some models returned');
|
||||
models.forEach(function(m) {
|
||||
should.not.equal(m.type, 'view', 'model type should not be a view');
|
||||
should.notEqual(m.type, 'view', 'model type should not be a view');
|
||||
});
|
||||
done(null, models);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
var should = require('./init.js');
|
||||
var sinon = require('sinon');
|
||||
|
||||
var Post, PostWithStringId, PostWithUniqueTitle, PostWithNumId, db;
|
||||
|
||||
|
@ -23,7 +24,7 @@ ObjectID.prototype.toJSON = function() {
|
|||
|
||||
describe('mysql', function() {
|
||||
before(function(done) {
|
||||
db = getDataSource();
|
||||
db = global.getDataSource();
|
||||
|
||||
Post = db.define('PostWithDefaultId', {
|
||||
title: {type: String, length: 255, index: true},
|
||||
|
@ -257,7 +258,8 @@ describe('mysql', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('save should update the instance without removing existing properties', function(done) {
|
||||
it('save should update the instance without removing existing properties',
|
||||
function(done) {
|
||||
Post.create({title: 'a', content: 'AAA'}, function(err, post) {
|
||||
delete post.title;
|
||||
post.save(function(err, p) {
|
||||
|
@ -270,7 +272,6 @@ describe('mysql', function() {
|
|||
|
||||
p.content.should.be.equal(post.content);
|
||||
p.title.should.be.equal('a');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -15,7 +15,8 @@ var db, Post, Review;
|
|||
|
||||
describe('transactions with promise', function() {
|
||||
before(function(done) {
|
||||
db = getDataSource({collation: 'utf8_general_ci', createDatabase: true});
|
||||
db = global.getDataSource({collation: 'utf8_general_ci',
|
||||
createDatabase: true});
|
||||
db.once('connected', function() {
|
||||
Post = db.define('PostTX', {
|
||||
title: {type: String, length: 255, index: true},
|
||||
|
|
|
@ -12,7 +12,8 @@ var db, Post, Review;
|
|||
|
||||
describe('transactions', function() {
|
||||
before(function(done) {
|
||||
db = getDataSource({collation: 'utf8_general_ci', createDatabase: true});
|
||||
db = global.getDataSource({collation: 'utf8_general_ci',
|
||||
createDatabase: true});
|
||||
db.once('connected', function() {
|
||||
Post = db.define('PostTX', {
|
||||
title: {type: String, length: 255, index: true},
|
||||
|
|
Loading…
Reference in New Issue