Back-port fixes for linter errors from master

This commit is contained in:
Miroslav Bajtoš 2016-12-06 10:47:27 +01:00
parent a1b9b42d11
commit f8da9783bc
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
var modelBuilder = new ModelBuilder();
Color = modelBuilder.define('Color', {
var Color = modelBuilder.define('Color', {
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
// 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});

View File

@ -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();
});
});

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() {});
} 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() {