Merge pull request #1183 from strongloop/fix/eslint-errors-2x

Back-port fixes for linter errors from master
This commit is contained in:
Miroslav Bajtoš 2016-12-06 15:09:40 +01:00 committed by GitHub
commit de70d746e8
4 changed files with 6 additions and 5 deletions

View File

@ -106,7 +106,7 @@ Article.create(function(e, article) {
// should be able to attach a data source to an existing model // should be able to attach a data source to an existing model
var modelBuilder = new ModelBuilder(); var modelBuilder = new ModelBuilder();
Color = modelBuilder.define('Color', { var Color = modelBuilder.define('Color', {
name: String, name: String,
}); });

View File

@ -813,7 +813,7 @@ Memory.prototype.replaceOrCreate = function(model, data, options, callback) {
// Calling _createSync to update the collection in a sync way and // Calling _createSync to update the collection in a sync way and
// to guarantee to create it in the same turn of even loop // to guarantee to create it in the same turn of even loop
return self._createSync(model, data, function(err, id) { return self._createSync(model, data, function(err, id) {
if (err) return process.nextTick(function() { cb(err); }); if (err) return process.nextTick(function() { callback(err); });
self.saveToFile(id, function(err, id) { self.saveToFile(id, function(err, id) {
self.setIdValue(model, data, id); self.setIdValue(model, data, id);
callback(err, self.fromDb(model, data), {isNewInstance: true}); callback(err, self.fromDb(model, data), {isNewInstance: true});

View File

@ -417,7 +417,7 @@ describe('manipulation', function() {
.catch(done); .catch(done);
}); });
it('should save throw error on validation', function() { it('should save throw error on validation', function(done) {
Person.findOne(function(err, p) { Person.findOne(function(err, p) {
should.not.exist(err); should.not.exist(err);
p.isValid = function(cb) { p.isValid = function(cb) {
@ -429,6 +429,7 @@ describe('manipulation', function() {
'throws': true, 'throws': true,
}); });
}).should.throw(ValidationError); }).should.throw(ValidationError);
done();
}); });
}); });

View File

@ -1446,7 +1446,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
}); });
}); });
if (!getSchema().connector.replaceById) { if (!dataSource.connector.replaceById) {
describe.skip('replaceById - not implemented', function() {}); describe.skip('replaceById - not implemented', function() {});
} else { } else {
describe('PersistedModel.prototype.replaceAttributes', function() { describe('PersistedModel.prototype.replaceAttributes', function() {
@ -2103,7 +2103,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
}); });
}); });
if (!getSchema().connector.replaceById) { if (!dataSource.connector.replaceById) {
describe.skip('replaceById - not implemented', function() {}); describe.skip('replaceById - not implemented', function() {});
} else { } else {
describe('PersistedModel.replaceOrCreate', function() { describe('PersistedModel.replaceOrCreate', function() {