From e038b28e8c934278d182c81c06a0b5be3e370bf2 Mon Sep 17 00:00:00 2001 From: Amir Jafarian Date: Wed, 19 Oct 2016 17:35:26 -0400 Subject: [PATCH] Fix manually --- examples/app-noschema.js | 1 + examples/app.js | 1 + examples/datasource-app.js | 1 + examples/inclusion.js | 1 + examples/load-schemas.js | 1 + examples/nesting-schema.js | 1 + examples/relations.js | 1 + index.js | 1 + lib/browser.depd.js | 1 + lib/connectors/memory.js | 1 + lib/connectors/transient.js | 1 + lib/dao.js | 4 ++++ lib/datasource.js | 4 ++++ lib/geo.js | 1 + lib/hooks.js | 1 + lib/include.js | 1 + lib/include_utils.js | 1 + lib/introspection.js | 1 + lib/jutil.js | 1 + lib/list.js | 1 + lib/mixins.js | 1 + lib/model-builder.js | 1 + lib/model-definition.js | 1 + lib/model.js | 4 ++++ lib/observer.js | 1 + lib/relation-definition.js | 4 ++++ lib/relations.js | 1 + lib/scope.js | 1 + lib/transaction.js | 1 + lib/types.js | 1 + lib/utils.js | 1 + lib/validations.js | 1 + test/CustomTypeForeignKey.test.js | 1 + test/async-observer.test.js | 1 + test/basic-querying.test.js | 1 + test/common.batch.js | 1 + test/common_test.js | 1 + test/crud-with-options.test.js | 1 + test/datasource.test.js | 1 + test/datatype.test.js | 3 ++- test/default-scope.test.js | 1 + test/defaults.test.js | 1 + test/discovery.test.js | 7 ++++--- test/events.js | 1 + test/geo.test.js | 1 + test/helpers/context-test-helpers.js | 1 + test/helpers/hook-monitor.js | 1 + test/helpers/uid-generator.js | 1 + test/hooks.test.js | 1 + test/include.test.js | 1 + test/include_util.test.js | 1 + test/init.js | 1 + test/introspection.test.js | 1 + test/json.test.js | 1 + test/kv-memory.js | 2 ++ test/loopback-data.test.js | 1 + test/loopback-dl.test.js | 9 +++++---- test/manipulation.test.js | 5 +++-- test/memory.test.js | 1 + test/mixins.test.js | 1 + test/model-definition.test.js | 1 + test/operation-hooks.suite/embeds-many-create.suite.js | 1 + test/operation-hooks.suite/embeds-many-destroy.suite.js | 3 ++- .../embeds-many-update-by-id.suite.js | 1 + test/operation-hooks.suite/embeds-one-create.suite.js | 1 + test/operation-hooks.suite/embeds-one-destroy.suite.js | 3 ++- test/operation-hooks.suite/embeds-one-update.suite.js | 1 + test/operation-hooks.suite/index.js | 2 ++ test/optional-validation.test.js | 1 + test/persistence-hooks.suite.js | 1 + test/relations.test.js | 4 +++- test/schema.test.js | 1 + test/scope.test.js | 1 + test/spec_helper.js | 1 + test/transient.test.js | 1 + test/util.test.js | 1 + test/validations.test.js | 1 + 77 files changed, 105 insertions(+), 13 deletions(-) diff --git a/examples/app-noschema.js b/examples/app-noschema.js index 0d9d4e92..d45dedad 100644 --- a/examples/app-noschema.js +++ b/examples/app-noschema.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var DataSource = require('../../loopback-datasource-juggler').DataSource; var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder; diff --git a/examples/app.js b/examples/app.js index 8f0bf98f..6c65b91f 100644 --- a/examples/app.js +++ b/examples/app.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder; var modelBuilder = new ModelBuilder(); diff --git a/examples/datasource-app.js b/examples/datasource-app.js index 5e60173a..ec71bd2f 100644 --- a/examples/datasource-app.js +++ b/examples/datasource-app.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var DataSource = require('../../loopback-datasource-juggler').DataSource; var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder; diff --git a/examples/inclusion.js b/examples/inclusion.js index f51a362d..d70dfbeb 100644 --- a/examples/inclusion.js +++ b/examples/inclusion.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var jdb = require('../index'); diff --git a/examples/load-schemas.js b/examples/load-schemas.js index 2359b00c..724b8464 100644 --- a/examples/load-schemas.js +++ b/examples/load-schemas.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var path = require('path'), fs = require('fs'), diff --git a/examples/nesting-schema.js b/examples/nesting-schema.js index 1d553a39..f0e17b99 100644 --- a/examples/nesting-schema.js +++ b/examples/nesting-schema.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder; var modelBuilder = new ModelBuilder(); diff --git a/examples/relations.js b/examples/relations.js index 156e1a46..baec0b12 100644 --- a/examples/relations.js +++ b/examples/relations.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var DataSource = require('../index').DataSource; var ds = new DataSource('memory'); diff --git a/index.js b/index.js index bdb84fb0..18e9e292 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var SG = require('strong-globalize'); SG.SetRootDir(__dirname); diff --git a/lib/browser.depd.js b/lib/browser.depd.js index 6148c600..7bcc3536 100644 --- a/lib/browser.depd.js +++ b/lib/browser.depd.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // A lightweight alternative to "depd" that works in the browser module.exports = function depd(namespace) { diff --git a/lib/connectors/memory.js b/lib/connectors/memory.js index c14b46ba..a831318e 100644 --- a/lib/connectors/memory.js +++ b/lib/connectors/memory.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var g = require('strong-globalize')(); var util = require('util'); diff --git a/lib/connectors/transient.js b/lib/connectors/transient.js index 19a5cd9f..86917d4d 100644 --- a/lib/connectors/transient.js +++ b/lib/connectors/transient.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var g = require('strong-globalize')(); var util = require('util'); diff --git a/lib/dao.js b/lib/dao.js index e0c32af7..1c9ff392 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -3,6 +3,10 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +// Turning on strict for this file breaks lots of test cases; +// disabling strict for this file +/* eslint-disable strict */ + /*! * Module exports class Model */ diff --git a/lib/datasource.js b/lib/datasource.js index 7dbf73a6..3ec50762 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -3,6 +3,10 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +// Turning on strict for this file breaks lots of test cases; +// disabling strict for this file +/* eslint-disable strict */ + /*! * Module dependencies */ diff --git a/lib/geo.js b/lib/geo.js index a90018b8..5189efe5 100644 --- a/lib/geo.js +++ b/lib/geo.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var assert = require('assert'); diff --git a/lib/hooks.js b/lib/hooks.js index 1d809870..cb760e37 100644 --- a/lib/hooks.js +++ b/lib/hooks.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var deprecated = require('depd')('loopback-datasource-juggler'); var g = require('strong-globalize')(); diff --git a/lib/include.js b/lib/include.js index 99277915..2098e9cb 100644 --- a/lib/include.js +++ b/lib/include.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var async = require('async'); var g = require('strong-globalize')(); diff --git a/lib/include_utils.js b/lib/include_utils.js index 2a65cacf..1585fa85 100644 --- a/lib/include_utils.js +++ b/lib/include_utils.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; module.exports.buildOneToOneIdentityMapWithOrigKeys = buildOneToOneIdentityMapWithOrigKeys; module.exports.buildOneToManyIdentityMapWithOrigKeys = buildOneToManyIdentityMapWithOrigKeys; diff --git a/lib/introspection.js b/lib/introspection.js index ce1a9c82..08b9c12f 100644 --- a/lib/introspection.js +++ b/lib/introspection.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; module.exports = function getIntrospector(ModelBuilder) { function introspectType(value) { diff --git a/lib/jutil.js b/lib/jutil.js index 128d6d16..5cb17aa8 100644 --- a/lib/jutil.js +++ b/lib/jutil.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var util = require('util'); diff --git a/lib/list.js b/lib/list.js index 9800a319..9052c04b 100644 --- a/lib/list.js +++ b/lib/list.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var g = require('strong-globalize')(); var util = require('util'); diff --git a/lib/mixins.js b/lib/mixins.js index e9e04d60..5b8eb91f 100644 --- a/lib/mixins.js +++ b/lib/mixins.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var debug = require('debug')('loopback:mixin'); var assert = require('assert'); diff --git a/lib/model-builder.js b/lib/model-builder.js index 9e9225e2..346bde16 100644 --- a/lib/model-builder.js +++ b/lib/model-builder.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; /*! * Module dependencies diff --git a/lib/model-definition.js b/lib/model-definition.js index 216f3c9f..280caa54 100644 --- a/lib/model-definition.js +++ b/lib/model-definition.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var assert = require('assert'); var util = require('util'); diff --git a/lib/model.js b/lib/model.js index e7832598..48664738 100644 --- a/lib/model.js +++ b/lib/model.js @@ -3,6 +3,10 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +// Turning on strict for this file breaks lots of test cases; +// disabling strict for this file +/* eslint-disable strict */ + /*! * Module exports class Model */ diff --git a/lib/observer.js b/lib/observer.js index f2046eb4..3e493e28 100644 --- a/lib/observer.js +++ b/lib/observer.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var async = require('async'); var utils = require('./utils'); diff --git a/lib/relation-definition.js b/lib/relation-definition.js index a6862931..498945a3 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -3,6 +3,10 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +// Turning on strict for this file breaks lots of test cases; +// disabling strict for this file +/* eslint-disable strict */ + /*! * Dependencies */ diff --git a/lib/relations.js b/lib/relations.js index b4a2c8b5..c7145c1a 100644 --- a/lib/relations.js +++ b/lib/relations.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; /*! * Dependencies diff --git a/lib/scope.js b/lib/scope.js index e876b365..6fdd14c5 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; /*eslint-disable camelcase*/ diff --git a/lib/transaction.js b/lib/transaction.js index db8312f9..97e535d0 100644 --- a/lib/transaction.js +++ b/lib/transaction.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var g = require('strong-globalize')(); var debug = require('debug')('loopback:connector:transaction'); diff --git a/lib/types.js b/lib/types.js index c0829a5d..12140386 100644 --- a/lib/types.js +++ b/lib/types.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var Types = {}; /** diff --git a/lib/utils.js b/lib/utils.js index 1b5127ce..3297af7e 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; exports.safeRequire = safeRequire; exports.fieldsToArray = fieldsToArray; diff --git a/lib/validations.js b/lib/validations.js index 69d4a1ce..09aebdf4 100644 --- a/lib/validations.js +++ b/lib/validations.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var g = require('strong-globalize')(); var util = require('util'); diff --git a/test/CustomTypeForeignKey.test.js b/test/CustomTypeForeignKey.test.js index 6adc7583..63acaf65 100644 --- a/test/CustomTypeForeignKey.test.js +++ b/test/CustomTypeForeignKey.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var should = require('./init.js'); diff --git a/test/async-observer.test.js b/test/async-observer.test.js index f25ba60c..7360e7a2 100644 --- a/test/async-observer.test.js +++ b/test/async-observer.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ModelBuilder = require('../').ModelBuilder; var should = require('./init'); diff --git a/test/basic-querying.test.js b/test/basic-querying.test.js index 2fea7462..89b71731 100644 --- a/test/basic-querying.test.js +++ b/test/basic-querying.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/common.batch.js b/test/common.batch.js index 0e5c69c2..41d1f167 100644 --- a/test/common.batch.js +++ b/test/common.batch.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; require('./datatype.test.js'); require('./basic-querying.test.js'); diff --git a/test/common_test.js b/test/common_test.js index 75b226a4..f4141af3 100644 --- a/test/common_test.js +++ b/test/common_test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var Schema = require('../index').Schema; var Text = Schema.Text; diff --git a/test/crud-with-options.test.js b/test/crud-with-options.test.js index be862584..ed4dff1d 100644 --- a/test/crud-with-options.test.js +++ b/test/crud-with-options.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/datasource.test.js b/test/datasource.test.js index 802c422e..ec411c57 100644 --- a/test/datasource.test.js +++ b/test/datasource.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var should = require('./init.js'); var DataSource = require('../lib/datasource.js').DataSource; diff --git a/test/datatype.test.js b/test/datatype.test.js index ad5d947f..4476f163 100644 --- a/test/datatype.test.js +++ b/test/datatype.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); @@ -11,7 +12,7 @@ var db, Model; describe('datatypes', function() { before(function(done) { db = getSchema(); - Nested = db.define('Nested', {}); + var Nested = db.define('Nested', {}); Model = db.define('Model', { str: String, diff --git a/test/default-scope.test.js b/test/default-scope.test.js index 7e926513..aa77793e 100644 --- a/test/default-scope.test.js +++ b/test/default-scope.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/defaults.test.js b/test/defaults.test.js index 6ab7ac45..fd6efeb0 100644 --- a/test/defaults.test.js +++ b/test/defaults.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/discovery.test.js b/test/discovery.test.js index 22f7ce6b..7a89675c 100644 --- a/test/discovery.test.js +++ b/test/discovery.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var jdb = require('../'); var DataSource = jdb.DataSource; @@ -436,7 +437,7 @@ describe('discoverModelProperties', function() { describe('discoverPrimaryKeys', function() { var ds; - var modelProperties; + var modelProperties, primaryKeys; before(function() { ds = new DataSource({connector: 'memory'}); @@ -496,7 +497,7 @@ describe('discoverPrimaryKeys', function() { describe('discoverForeignKeys', function() { var ds; - var modelProperties; + var modelProperties, foreignKeys; before(function() { ds = new DataSource({connector: 'memory'}); @@ -553,7 +554,7 @@ describe('discoverForeignKeys', function() { describe('discoverExportedForeignKeys', function() { var ds; - var modelProperties; + var modelProperties, exportedForeignKeys; before(function() { ds = new DataSource({connector: 'memory'}); diff --git a/test/events.js b/test/events.js index 44761cec..191e0c50 100644 --- a/test/events.js +++ b/test/events.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var should = require('./init.js'); diff --git a/test/geo.test.js b/test/geo.test.js index b2f26da9..ee888a4b 100644 --- a/test/geo.test.js +++ b/test/geo.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; /*global describe,it*/ /*jshint expr:true */ diff --git a/test/helpers/context-test-helpers.js b/test/helpers/context-test-helpers.js index cb8d0dc4..752cbb0f 100644 --- a/test/helpers/context-test-helpers.js +++ b/test/helpers/context-test-helpers.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var traverse = require('traverse'); diff --git a/test/helpers/hook-monitor.js b/test/helpers/hook-monitor.js index 20af6cbc..0197e197 100644 --- a/test/helpers/hook-monitor.js +++ b/test/helpers/hook-monitor.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; module.exports = HookMonitor; diff --git a/test/helpers/uid-generator.js b/test/helpers/uid-generator.js index f2bc95b4..fcf5f4da 100644 --- a/test/helpers/uid-generator.js +++ b/test/helpers/uid-generator.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var lastId = 0; diff --git a/test/hooks.test.js b/test/hooks.test.js index f1a6b209..5fe4f3aa 100644 --- a/test/hooks.test.js +++ b/test/hooks.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/include.test.js b/test/include.test.js index ec3beb43..616d0a6d 100644 --- a/test/include.test.js +++ b/test/include.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/include_util.test.js b/test/include_util.test.js index b9388f5e..320a6080 100644 --- a/test/include_util.test.js +++ b/test/include_util.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; /* eslint-disable camelcase */ diff --git a/test/init.js b/test/init.js index 612c595c..11983c64 100644 --- a/test/init.js +++ b/test/init.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; module.exports = require('should'); diff --git a/test/introspection.test.js b/test/introspection.test.js index 84dc40ea..35e86296 100644 --- a/test/introspection.test.js +++ b/test/introspection.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var assert = require('assert'); var ModelBuilder = require('..').ModelBuilder; diff --git a/test/json.test.js b/test/json.test.js index 9a8278f1..a07cc4aa 100644 --- a/test/json.test.js +++ b/test/json.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/kv-memory.js b/test/kv-memory.js index ba40c23b..93e604c6 100644 --- a/test/kv-memory.js +++ b/test/kv-memory.js @@ -1,3 +1,5 @@ +'use strict'; + var kvMemory = require('../lib/connectors/kv-memory'); var DataSource = require('..').DataSource; diff --git a/test/loopback-data.test.js b/test/loopback-data.test.js index 05e9fa22..5bec6170 100644 --- a/test/loopback-data.test.js +++ b/test/loopback-data.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/loopback-dl.test.js b/test/loopback-dl.test.js index 27117561..3d5901bb 100644 --- a/test/loopback-dl.test.js +++ b/test/loopback-dl.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); @@ -574,7 +575,7 @@ describe('DataSource define model', function() { it('should update the instance with unknown properties', function(done) { var ds = new DataSource('memory');// define models - Post = ds.define('Post', { + var Post = ds.define('Post', { title: {type: String, length: 255, index: true}, content: {type: String}, }); @@ -1558,17 +1559,17 @@ describe('DataAccessObject', function() { }); it('should normalize limit/offset/skip', function() { - filter = model._normalize({limit: '10', skip: 5}); + var filter = model._normalize({limit: '10', skip: 5}); assert.deepEqual(filter, {limit: 10, offset: 5, skip: 5}); }); it('should set the default value for limit', function() { - filter = model._normalize({skip: 5}); + var filter = model._normalize({skip: 5}); assert.deepEqual(filter, {limit: 100, offset: 5, skip: 5}); }); it('should apply settings for handling undefined', function() { - filter = model._normalize({filter: {x: undefined}}); + var filter = model._normalize({filter: {x: undefined}}); assert.deepEqual(filter, {filter: {}}); ds.settings.normalizeUndefinedInQuery = 'ignore'; diff --git a/test/manipulation.test.js b/test/manipulation.test.js index 9352e5cb..1c3333c7 100644 --- a/test/manipulation.test.js +++ b/test/manipulation.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var async = require('async'); @@ -50,7 +51,7 @@ describe('manipulation', function() { }); beforeEach(function resetStubPasswordCounter() { - stubPasswordCounter = 0; + var stubPasswordCounter = 0; }); describe('create', function() { @@ -1950,7 +1951,7 @@ describe('manipulation', function() { }); it('fails the upsertWithWhere operation when data object is empty', function(done) { - options = {}; + var options = {}; Person.upsertWithWhere({name: 'John Lennon'}, {}, options, function(err) { err.message.should.equal('data object cannot be empty!'); diff --git a/test/memory.test.js b/test/memory.test.js index 5f2fa92f..8650e535 100644 --- a/test/memory.test.js +++ b/test/memory.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var jdb = require('../'); var DataSource = jdb.DataSource; diff --git a/test/mixins.test.js b/test/mixins.test.js index c64b3927..f7660b45 100644 --- a/test/mixins.test.js +++ b/test/mixins.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/model-definition.test.js b/test/model-definition.test.js index f3289943..019db314 100644 --- a/test/model-definition.test.js +++ b/test/model-definition.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/operation-hooks.suite/embeds-many-create.suite.js b/test/operation-hooks.suite/embeds-many-create.suite.js index 86afae7b..1c5ee3aa 100644 --- a/test/operation-hooks.suite/embeds-many-create.suite.js +++ b/test/operation-hooks.suite/embeds-many-create.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ValidationError = require('../..').ValidationError; diff --git a/test/operation-hooks.suite/embeds-many-destroy.suite.js b/test/operation-hooks.suite/embeds-many-destroy.suite.js index 3babfd25..d982b0c6 100644 --- a/test/operation-hooks.suite/embeds-many-destroy.suite.js +++ b/test/operation-hooks.suite/embeds-many-destroy.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var Promise = require('bluebird'); var ValidationError = require('../..').ValidationError; @@ -46,7 +47,7 @@ module.exports = function(dataSource, should, connectorCapabilities) { } }); - var ownerInstance, existingInstance; + var ownerInstance, existingInstance, existingItem; beforeEach(function setupData() { return Owner.create({}) .then(function(inst) { diff --git a/test/operation-hooks.suite/embeds-many-update-by-id.suite.js b/test/operation-hooks.suite/embeds-many-update-by-id.suite.js index 930c3ddb..8f5e8ca9 100644 --- a/test/operation-hooks.suite/embeds-many-update-by-id.suite.js +++ b/test/operation-hooks.suite/embeds-many-update-by-id.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var Promise = require('bluebird'); var ValidationError = require('../..').ValidationError; diff --git a/test/operation-hooks.suite/embeds-one-create.suite.js b/test/operation-hooks.suite/embeds-one-create.suite.js index bd9495ee..db92c945 100644 --- a/test/operation-hooks.suite/embeds-one-create.suite.js +++ b/test/operation-hooks.suite/embeds-one-create.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ValidationError = require('../..').ValidationError; diff --git a/test/operation-hooks.suite/embeds-one-destroy.suite.js b/test/operation-hooks.suite/embeds-one-destroy.suite.js index 1b425655..13b56e0f 100644 --- a/test/operation-hooks.suite/embeds-one-destroy.suite.js +++ b/test/operation-hooks.suite/embeds-one-destroy.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ValidationError = require('../..').ValidationError; @@ -45,7 +46,7 @@ module.exports = function(dataSource, should, connectorCapabilities) { } }); - var ownerInstance, existingInstance; + var ownerInstance, existingInstance, existingItem; beforeEach(function setupData() { return Owner.create({}) .then(function(inst) { diff --git a/test/operation-hooks.suite/embeds-one-update.suite.js b/test/operation-hooks.suite/embeds-one-update.suite.js index 24d80ae4..739f9f36 100644 --- a/test/operation-hooks.suite/embeds-one-update.suite.js +++ b/test/operation-hooks.suite/embeds-one-update.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ValidationError = require('../..').ValidationError; diff --git a/test/operation-hooks.suite/index.js b/test/operation-hooks.suite/index.js index 1b9fcab7..3f43346d 100644 --- a/test/operation-hooks.suite/index.js +++ b/test/operation-hooks.suite/index.js @@ -1,3 +1,5 @@ +'use strict'; + var debug = require('debug')('test'); var fs = require('fs'); var path = require('path'); diff --git a/test/optional-validation.test.js b/test/optional-validation.test.js index 545154a3..1e487699 100644 --- a/test/optional-validation.test.js +++ b/test/optional-validation.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var async = require('async'); diff --git a/test/persistence-hooks.suite.js b/test/persistence-hooks.suite.js index 40d7a3a3..fc4ba6e3 100644 --- a/test/persistence-hooks.suite.js +++ b/test/persistence-hooks.suite.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var ValidationError = require('../').ValidationError; diff --git a/test/relations.test.js b/test/relations.test.js index 999b8347..df541798 100644 --- a/test/relations.test.js +++ b/test/relations.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); @@ -3828,7 +3829,7 @@ describe('relations', function() { // This test spefically uses the Memory connector // in order to test the use of the auto-generated // id, in the sequence of the related model. - + var Passport; before(function() { db = getMemoryDataSource(); Person = db.define('Person', {name: String}); @@ -3879,6 +3880,7 @@ describe('relations', function() { }); describe('embedsOne - generated id', function() { + var Passport; before(function() { tmp = getTransientDataSource(); // db = getSchema(); diff --git a/test/schema.test.js b/test/schema.test.js index 26fa64be..9b8ab2a1 100644 --- a/test/schema.test.js +++ b/test/schema.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/scope.test.js b/test/scope.test.js index 5cbe4ff2..a083d7ac 100644 --- a/test/scope.test.js +++ b/test/scope.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js'); diff --git a/test/spec_helper.js b/test/spec_helper.js index 27a75c61..fed74bf2 100644 --- a/test/spec_helper.js +++ b/test/spec_helper.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; /* eslint-disable camelcase */ diff --git a/test/transient.test.js b/test/transient.test.js index def9da00..d4d49b48 100644 --- a/test/transient.test.js +++ b/test/transient.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var jdb = require('../'); var DataSource = jdb.DataSource; diff --git a/test/util.test.js b/test/util.test.js index 30aaab3f..9be3099b 100644 --- a/test/util.test.js +++ b/test/util.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; var should = require('./init.js'); var utils = require('../lib/utils'); diff --git a/test/validations.test.js b/test/validations.test.js index 9a5464ea..de967dec 100644 --- a/test/validations.test.js +++ b/test/validations.test.js @@ -2,6 +2,7 @@ // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +'use strict'; // This test written in mocha+should.js var should = require('./init.js');