From f8da9783bcb8b08d22e47905c1514de5656576f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 6 Dec 2016 10:47:27 +0100 Subject: [PATCH] Back-port fixes for linter errors from master --- examples/datasource-app.js | 2 +- lib/connectors/memory.js | 2 +- test/manipulation.test.js | 3 ++- test/persistence-hooks.suite.js | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/datasource-app.js b/examples/datasource-app.js index ec71bd2fb..3fc1acbe5 100644 --- a/examples/datasource-app.js +++ b/examples/datasource-app.js @@ -106,7 +106,7 @@ Article.create(function(e, article) { // should be able to attach a data source to an existing model var modelBuilder = new ModelBuilder(); -Color = modelBuilder.define('Color', { +var Color = modelBuilder.define('Color', { name: String, }); diff --git a/lib/connectors/memory.js b/lib/connectors/memory.js index a831318e6..586ea958d 100644 --- a/lib/connectors/memory.js +++ b/lib/connectors/memory.js @@ -813,7 +813,7 @@ Memory.prototype.replaceOrCreate = function(model, data, options, callback) { // Calling _createSync to update the collection in a sync way and // to guarantee to create it in the same turn of even loop 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.setIdValue(model, data, id); callback(err, self.fromDb(model, data), {isNewInstance: true}); diff --git a/test/manipulation.test.js b/test/manipulation.test.js index 1c3333c78..783d8049f 100644 --- a/test/manipulation.test.js +++ b/test/manipulation.test.js @@ -417,7 +417,7 @@ describe('manipulation', function() { .catch(done); }); - it('should save throw error on validation', function() { + it('should save throw error on validation', function(done) { Person.findOne(function(err, p) { should.not.exist(err); p.isValid = function(cb) { @@ -429,6 +429,7 @@ describe('manipulation', function() { 'throws': true, }); }).should.throw(ValidationError); + done(); }); }); diff --git a/test/persistence-hooks.suite.js b/test/persistence-hooks.suite.js index fc4ba6e39..69947f2c4 100644 --- a/test/persistence-hooks.suite.js +++ b/test/persistence-hooks.suite.js @@ -1446,7 +1446,7 @@ module.exports = function(dataSource, should, connectorCapabilities) { }); }); - if (!getSchema().connector.replaceById) { + if (!dataSource.connector.replaceById) { describe.skip('replaceById - not implemented', function() {}); } else { 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() {}); } else { describe('PersistedModel.replaceOrCreate', function() {